-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
74 lines (68 loc) · 2.3 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
version: "3.8"
services:
worker: &worker
image: iloveitaly/crypto-index-fund-bot
restart: always
command: ./scripts/celery.sh
env_file: .env
depends_on:
- postgres
- redis
environment:
# `kuma` has a lot of interesting ENV overrides to look at if this app ever gets bigger
- DATABASE_URL=postgresql://${POSTGRES_DATABASE_USER:-postgres}:${POSTGRES_DATABASE_PASSWORD:-postgres}@postgres:5432/crypto_index_fund_bot
- REDIS_URL=redis://redis:6379
- DEBUG=${DEBUG:-True}
# Other environment overrides
- PYTHONDONTWRITEBYTECODE=1
# https://stackoverflow.com/questions/59812009/what-is-the-use-of-pythonunbuffered-in-docker-file/59812588
- PYTHONUNBUFFERED=True
- PYTHONWARNINGS=${PYTHONWARNINGS:-}
- MAINTENANCE_MODE=${MAINTENANCE_MODE:-False}
# TODO right now there is no web worker, but I'm leaving this here in case we use it in the future
# Web is based on worker b/c you cannot clear the "ports" with docker-compose.
# web:
# <<: *worker
# command: gunicorn -w ${GUNICORN_WORKERS:-4} --bind 0.0.0.0:8000 --access-logfile=- --timeout=120 --worker-class=gevent botweb.wsgi:application
# depends_on:
# - postgres
# - redis
# ports:
# - "8000:8000"
# https://hub.docker.com/_/postgres/
postgres:
image: postgres:13.4
restart: always
environment:
# Create the superuser account
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=crypto_index_fund_bot
volumes:
- postgres:/var/lib/postgresql/data
ports:
# 5901 is a random port to avoid collision with other postgres services
# if you are running this in a public environment, you should eliminate
# this port mapping
- "5901:5432"
# https://hub.docker.com/_/redis
redis:
image: redis:6.2
restart: always
db_backup:
image: schickling/postgres-backup-s3:latest
restart: always
depends_on:
- postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_BACKUP_ALL: true
POSTGRES_HOST: postgres
S3_ACCESS_KEY_ID: KEY_ID
S3_SECRET_ACCESS_KEY: ACCESS_KEY
S3_BUCKET: bucket
S3_ENDPOINT: https://s3.compatible.endpoint.com
SCHEDULE: '@weekly'
volumes:
postgres: