This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
103 lines (98 loc) · 2.21 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
98
99
100
101
102
103
services:
www:
build:
context: ./
image: ghcr.io/codl/forget
pull_policy: missing
restart: always
volumes:
- type: bind
source: ./config.py
target: /usr/src/app/config.py
read_only: true
depends_on:
- redis
- db
- worker
- beat
command: bash -c "
flask db upgrade &&
gunicorn -w 9 -t 3600 -b 0.0.0.0:42157 forget:app
"
networks:
- forget
expose:
- 42157
ports:
- "127.0.0.1:42157:42157"
worker:
build:
context: ./
image: ghcr.io/codl/forget
pull_policy: missing
restart: always
volumes:
- type: bind
source: ./config.py
target: /usr/src/app/config.py
read_only: true
- ./data/celery/run:/var/run/celery
depends_on:
- redis
- db
networks:
- forget
command: bash -c "
mkdir -p /var/run/celery &&
chown -R nobody:nogroup /var/run/celery &&
exec celery --app=tasks worker
--loglevel=INFO
--statedb=/var/run/celery/worker.state
--hostname=worker
--uid=nobody --gid=nogroup
"
beat:
build:
context: ./
image: ghcr.io/codl/forget
pull_policy: missing
restart: always
volumes:
- type: bind
source: ./config.py
target: /usr/src/app/config.py
read_only: true
- ./data/celery/run:/var/run/celery
depends_on:
- redis
- db
networks:
- forget
command: bash -c "
mkdir -p /var/run/celery &&
chown -R nobody:nogroup /var/run/celery &&
exec celery --app=tasks beat
--loglevel=INFO
--schedule=/var/run/celery/schedule
--uid=nobody --gid=nogroup
"
redis:
image: redis:4.0-alpine
restart: always
volumes:
- ./data/redis:/data
networks:
- forget
db:
image: postgres:14-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=forget
volumes:
- ./data/postgres:/var/lib/postgresql/data
networks:
- forget
networks:
forget: