-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (62 loc) · 1.63 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: '3.8'
services:
backend:
container_name: "backend"
build:
dockerfile: docker/Dockerfile_backend
image: backend_image
volumes:
- ./backend:/app
ports:
# api
- 3000:3000
# prisma studio
- 5555:5555
networks:
- transcendence-network
env_file:
- .env
depends_on:
database:
condition: service_healthy
restart: always
frontend:
container_name: "frontend"
build:
dockerfile: docker/Dockerfile_frontend
image: frontend_image
volumes:
- ./frontend:/usr/src/app
ports:
- 8080:5173
networks:
- transcendence-network
env_file:
- .env
depends_on:
- database
- backend
restart: always
database:
healthcheck:
test: "PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} -w -d ${DB_NAME} -c 'select 1;'"
interval: 2s
retries: 120
timeout: 10s
container_name: "database"
build:
dockerfile: docker/Dockerfile_database
image: database_image
networks:
- transcendence-network
volumes:
- database_volume:/var/lib/postgresql/data
env_file:
- .env
restart: always
# Cannot use bind volume because we don't have permissions,
# postgres official image use the postgres user.
volumes:
database_volume:
networks:
transcendence-network: