-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
58 lines (57 loc) · 1.45 KB
/
docker-compose.yaml
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
services:
backend:
build: ./backend
expose:
- 3000
environment:
- PORT=${PORT}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=fotleague
- SESSION_SECRET=${SESSION_SECRET}
ports:
- "${PORT}:3000"
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/app
healthcheck:
test: ["CMD-SHELL", '[[ $(curl -sw "%{http_code}" -o /dev/null http://localhost:3000) == "200" ]] && exit 0']
interval: 5s
timeout: 30s
retries: 5
db:
image: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=fotleague
volumes:
- fotleague-db:/var/lib/postgresql/data
- ./backend/sql/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d fotleague"]
interval: 5s
timeout: 5s
retries: 5
db_test:
image: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=fotleague
volumes:
- ./backend/sql/init.sql:/docker-entrypoint-initdb.d/init.sql
python:
build: ./scraping
volumes:
- ./scraping:/app
environment:
- PYTHONUNBUFFERED=1
- PORT=${PORT}
depends_on:
backend:
condition: service_healthy
volumes:
fotleague-db: