2022-07-30 09:10:43 +02:00
|
|
|
services:
|
2022-08-05 00:21:40 +02:00
|
|
|
www:
|
2022-07-31 00:32:15 +02:00
|
|
|
build:
|
|
|
|
context: ./
|
2022-08-10 09:37:13 +02:00
|
|
|
image: ghcr.io/codl/forget
|
|
|
|
pull_policy: missing
|
2022-07-30 09:10:43 +02:00
|
|
|
restart: always
|
|
|
|
volumes:
|
2022-08-05 00:21:40 +02:00
|
|
|
- type: bind
|
|
|
|
source: ./config.py
|
|
|
|
target: /usr/src/app/config.py
|
|
|
|
read_only: true
|
2022-07-30 09:10:43 +02:00
|
|
|
depends_on:
|
2022-08-05 00:21:40 +02:00
|
|
|
- redis
|
|
|
|
- db
|
|
|
|
- worker
|
|
|
|
- beat
|
2022-07-30 09:10:43 +02:00
|
|
|
command: bash -c "
|
|
|
|
flask db upgrade &&
|
|
|
|
gunicorn -w 9 -t 3600 -b 0.0.0.0:42157 forget:app
|
|
|
|
"
|
2022-08-05 00:21:40 +02:00
|
|
|
networks:
|
|
|
|
- forget
|
2022-07-30 09:10:43 +02:00
|
|
|
expose:
|
|
|
|
- 42157
|
2022-08-05 00:21:40 +02:00
|
|
|
ports:
|
|
|
|
- "127.0.0.1:42157:42157"
|
2022-07-30 09:10:43 +02:00
|
|
|
|
2022-08-05 00:21:40 +02:00
|
|
|
worker:
|
2022-07-31 00:32:15 +02:00
|
|
|
build:
|
|
|
|
context: ./
|
2022-08-10 09:37:13 +02:00
|
|
|
image: ghcr.io/codl/forget
|
|
|
|
pull_policy: missing
|
2022-07-30 09:10:43 +02:00
|
|
|
restart: always
|
|
|
|
volumes:
|
2022-08-05 00:21:40 +02:00
|
|
|
- type: bind
|
|
|
|
source: ./config.py
|
|
|
|
target: /usr/src/app/config.py
|
|
|
|
read_only: true
|
|
|
|
- ./data/celery/run:/var/run/celery
|
2022-07-30 09:10:43 +02:00
|
|
|
depends_on:
|
2022-08-05 00:21:40 +02:00
|
|
|
- redis
|
|
|
|
- db
|
|
|
|
networks:
|
|
|
|
- forget
|
2022-07-30 09:10:43 +02:00
|
|
|
command: bash -c "
|
2022-07-31 01:21:52 +02:00
|
|
|
mkdir -p /var/run/celery &&
|
|
|
|
chown -R nobody:nogroup /var/run/celery &&
|
2022-07-30 09:10:43 +02:00
|
|
|
exec celery --app=tasks worker
|
2022-07-31 01:21:52 +02:00
|
|
|
--loglevel=INFO
|
2022-07-30 09:10:43 +02:00
|
|
|
--statedb=/var/run/celery/worker.state
|
|
|
|
--hostname=worker
|
|
|
|
--uid=nobody --gid=nogroup
|
|
|
|
"
|
|
|
|
|
2022-08-05 00:21:40 +02:00
|
|
|
beat:
|
2022-07-31 00:32:15 +02:00
|
|
|
build:
|
|
|
|
context: ./
|
2022-08-10 09:37:13 +02:00
|
|
|
image: ghcr.io/codl/forget
|
|
|
|
pull_policy: missing
|
2022-07-30 09:10:43 +02:00
|
|
|
restart: always
|
|
|
|
volumes:
|
2022-08-05 00:21:40 +02:00
|
|
|
- type: bind
|
|
|
|
source: ./config.py
|
|
|
|
target: /usr/src/app/config.py
|
|
|
|
read_only: true
|
|
|
|
- ./data/celery/run:/var/run/celery
|
2022-07-30 09:10:43 +02:00
|
|
|
depends_on:
|
2022-08-05 00:21:40 +02:00
|
|
|
- redis
|
|
|
|
- db
|
|
|
|
networks:
|
|
|
|
- forget
|
2022-07-30 21:40:41 +02:00
|
|
|
command: bash -c "
|
2022-07-31 01:21:52 +02:00
|
|
|
mkdir -p /var/run/celery &&
|
|
|
|
chown -R nobody:nogroup /var/run/celery &&
|
2022-07-30 21:40:41 +02:00
|
|
|
exec celery --app=tasks beat
|
2022-07-31 01:21:52 +02:00
|
|
|
--loglevel=INFO
|
2022-07-30 21:40:41 +02:00
|
|
|
--schedule=/var/run/celery/schedule
|
|
|
|
--uid=nobody --gid=nogroup
|
|
|
|
"
|
2022-07-30 09:10:43 +02:00
|
|
|
|
2022-08-05 00:21:40 +02:00
|
|
|
redis:
|
2022-07-30 09:10:43 +02:00
|
|
|
image: redis:4.0-alpine
|
|
|
|
restart: always
|
|
|
|
volumes:
|
2022-08-05 00:21:40 +02:00
|
|
|
- ./data/redis:/data
|
|
|
|
networks:
|
|
|
|
- forget
|
2022-07-30 09:10:43 +02:00
|
|
|
|
2022-08-05 00:21:40 +02:00
|
|
|
db:
|
2022-07-30 09:10:43 +02:00
|
|
|
image: postgres:14-alpine
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=postgres
|
|
|
|
- POSTGRES_PASSWORD=postgres
|
|
|
|
- POSTGRES_DB=forget
|
|
|
|
volumes:
|
2022-08-05 00:21:40 +02:00
|
|
|
- ./data/postgres:/var/lib/postgresql/data
|
|
|
|
networks:
|
|
|
|
- forget
|
|
|
|
|
|
|
|
networks:
|
|
|
|
forget:
|