/
docker-compose.yml
97 lines (88 loc) · 2.14 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
version: "3"
volumes:
database:
networks:
snapy:
nginx-proxy-manager_default:
external: true
mq:
external: true
services:
database:
image: postgres:15-alpine
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 2s
timeout: 5s
retries: 15
networks:
- snapy
volumes:
- database:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
app:
image: ghcr.io/spaceflightnewsapi/spaceflightnewsapi:${VERSION}
restart: unless-stopped
command:
- /bin/sh
- -c
- |
python manage.py collectstatic --no-input &&
python manage.py migrate --no-input &&
python manage.py createdefaulttasks &&
gunicorn snapy.wsgi:application --workers 4 --bind 0.0.0.0:8000 --access-logfile - --disable-redirect-access-to-syslog
networks:
- snapy
- nginx-proxy-manager_default
env_file: .env
depends_on:
database:
condition: service_healthy
beat:
image: ghcr.io/spaceflightnewsapi/spaceflightnewsapi:${VERSION}
restart: unless-stopped
command: celery -A snapy beat -l INFO
networks:
- mq
- snapy
env_file: .env
depends_on:
database:
condition: service_healthy
worker:
image: ghcr.io/spaceflightnewsapi/spaceflightnewsapi:${VERSION}
restart: unless-stopped
command: celery -A snapy worker -l INFO
networks:
- mq
- snapy
env_file: .env
depends_on:
database:
condition: service_healthy
consumer:
image: ghcr.io/spaceflightnewsapi/spaceflightnewsapi:${VERSION}
restart: unless-stopped
command: python manage.py consume
networks:
- mq
- snapy
env_file: .env
depends_on:
database:
condition: service_healthy
scraper:
image: ghcr.io/spaceflightnewsapi/snapiscraper:latest
restart: unless-stopped
networks:
- mq
- snapy
env_file: .env
depends_on:
database:
condition: service_healthy