build: setup docker containers for development
This commit is contained in:
61
compose.yaml
Normal file
61
compose.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
services:
|
||||
app:
|
||||
image: node:krypton-alpine
|
||||
user: "node"
|
||||
restart: no
|
||||
depends_on:
|
||||
- db
|
||||
working_dir: /home/node/app
|
||||
volumes:
|
||||
- ./app:/home/node/app
|
||||
develop:
|
||||
watch:
|
||||
- path: ./app/server
|
||||
action: sync+restart
|
||||
target: /home/node/app/server
|
||||
- path: ./app/public
|
||||
action: sync
|
||||
target: /home/node/app/public
|
||||
command: node --env-file=.env ./index.js
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: example
|
||||
POSTGRES_USER: myuser
|
||||
POSTGRES_DB: pathtoglory
|
||||
volumes:
|
||||
- pgdata:/home/arthur/sources/node/pathtoglory/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 1s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
nginx:
|
||||
image: nginx
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||||
depends_on:
|
||||
- app
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user