-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (42 loc) · 966 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
44
45
version: '3.8'
services:
# Create frontend container
frontend:
build: ./frontend
ports:
- "8000:8000"
container_name: frontend-docker
working_dir: /usr/src/app
volumes:
- ./frontend:/usr/src/app/frontend
- /usr/src/app/frontend/node_modules
tty: true
# Create backend container
backend:
build: ./backend
ports:
- "8080:8080"
container_name: backend-docker
working_dir: /usr/src/app
links:
- database
depends_on:
- database
volumes:
- ./backend:/usr/src/app/frontend
- /usr/src/app/backend/node_modules
# Create database container
postgres:
image: postgres:13-alpine3.18
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres-db:${POSTGRES_DATA_DIR}
ports:
- "5432:5432"
# Volumes
volumes:
postgres-db: