-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (33 loc) · 852 Bytes
/
docker-compose.yml
File metadata and controls
35 lines (33 loc) · 852 Bytes
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
version: '3.8'
services:
postgresdb:
image: postgres
restart: unless-stopped
env_file: ./.env
environment:
- POSTGRES_USER=$POSTGRESDB_USER
- POSTGRES_PASSWORD=$POSTGRESDB_ROOT_PASSWORD
- POSTGRES_DB=$POSTGRESDB_DATABASE
ports:
- $POSTGRESDB_LOCAL_PORT:$POSTGRESDB_DOCKER_PORT
volumes:
- db:/var/lib/postgres
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
app:
depends_on:
- postgresdb
build: ./grocery-app
restart: unless-stopped
env_file: ./.env
ports:
- $NODE_LOCAL_PORT:$NODE_DOCKER_PORT
environment:
- DB_HOST=postgresdb
- DB_USER=$POSTGRESDB_USER
- DB_PASSWORD=$POSTGRESDB_ROOT_PASSWORD
- DB_NAME=$POSTGRESDB_DATABASE
- DB_PORT=$POSTGRESDB_DOCKER_PORT
stdin_open: true
tty: true
volumes:
db: