-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
30 lines (28 loc) · 937 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
version: '2'
services:
backend:
# we can use a pre-built image
# but here we will build the docker image based on the Dockerfile in the current directory
build: .
ports:
- 8000:8000
- 9229:9229 # debugger port
volumes:
# map everything in the current local directory to the working directory in docker image
- .:/usr/src/app
- /usr/src/app/node_modules
command: yarn start:docker
depends_on:
# everytime before the "backend" services run, need to ensure that the postgres service has aldy run
- postgres
environment:
# the name after "@" (postgres in this case) should be the same as the name of the database service
DATABASE_URL: postgres://postgres@postgres/webapp_dev
PORT: 8000
postgres:
image: postgres:14-alpine
ports:
- 5432:5432
environment:
POSTGRES_DB: webapp_dev
POSTGRES_HOST_AUTH_METHOD: trust