-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
41 lines (35 loc) · 930 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
services:
POSTGRES:
container_name: BackendDB
image: postgres:13
environment:
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASS}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- '5432:5432'
networks:
- careconnect-network # Add this line to connect to the network
nodeserver:
build: .
container_name: NodeRestAPI
volumes:
- .:/app
- /app/node_modules
ports:
- '5000:5000'
env_file:
- .env.${NODE_ENV} # Dynamically load the correct .env file
command: >
sh -c "if [ \"$NODE_ENV\" = 'production' ]; then npm start; else npm run dev; fi"
depends_on:
- POSTGRES
networks:
- careconnect-network # Add this line to connect to the network
networks:
careconnect-network:
driver: bridge
volumes:
pgdata: