-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
43 lines (40 loc) · 1016 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
services:
backend:
container_name: backend
image: node:lts-alpine
ports:
- 3000:3000
working_dir: /usr/src/app
environment:
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_PORT=${DATABASE_PORT}
- DATABASE_USERNAME=${DATABASE_USERNAME}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=${DATABASE_HOST}
command: sh -c "npm install && npm run start:dev"
networks:
- dev_and_deliver_network
volumes:
- ./:/usr/src/app
restart: unless-stopped
depends_on:
- postgres
postgres:
container_name: postgres
image: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=${DATABASE_USERNAME}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
networks:
- dev_and_deliver_network
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
dev_and_deliver_network:
driver: bridge
volumes:
postgres_data: {}