mirror of
https://github.com/bra1n/townsquare.git
synced 2025-04-04 22:24:36 +00:00
Dockerization of dev env
This commit is contained in:
parent
0922406b92
commit
88d47a4391
4 changed files with 32 additions and 0 deletions
3
.env.template
Normal file
3
.env.template
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
NODE_PORT=8080
|
||||||
|
SSH_KEYS=""# path to user/.ssh folder. Note : this folder needs to be owned by root in wsl. This requires having 2 separate ssh folders if you have other docker instances requiring a www-data owned ssh folder
|
||||||
|
PROJECT_LOCAL_PATH=D:/Projets/Townsquare
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@ node_modules
|
||||||
dist
|
dist
|
||||||
*.pem
|
*.pem
|
||||||
*.log
|
*.log
|
||||||
|
.env
|
||||||
|
docker-compose.yml
|
||||||
|
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
FROM node:16
|
||||||
|
RUN apt update && apt install -y\
|
||||||
|
git
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json .
|
||||||
|
RUN npm install
|
||||||
|
# npm rebuild avoids having misconfigurations if npm install has been run in the folder from windows before building the docker image
|
||||||
|
RUN npm rebuild
|
||||||
|
COPY . .
|
||||||
|
CMD ["npm","run","serve"]
|
17
docker-compose.template.yml
Normal file
17
docker-compose.template.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
version: "3.5"
|
||||||
|
services:
|
||||||
|
blood_on_the_clocktower:
|
||||||
|
container_name: frontend
|
||||||
|
build: "${PROJECT_LOCAL_PATH}"
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- "${SSH_KEYS}:/root/.ssh"
|
||||||
|
environment:
|
||||||
|
NODE_ENV: development
|
||||||
|
ports:
|
||||||
|
- "${NODE_PORT}:8080"
|
||||||
|
working_dir: /app
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "200k"
|
Loading…
Add table
Reference in a new issue