-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.prod.yml
87 lines (86 loc) · 2.42 KB
/
docker-compose.prod.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
version: "3"
volumes:
node_modules:
services:
postgres:
restart: always
image: postgres:10-alpine
environment:
- POSTGRES_USER=${THICC_USER}
- POSTGRES_PASSWORD=${THICC_PASSWORD}
- POSTGRES_DB=${THICC_DB}
volumes:
- ./postgres-data/postgres:/var/lib/postgresql/data:rw
pgbackups:
image: prodrigestivill/postgres-backup-local
restart: always
volumes:
- ./pg-backups:/backups
links:
- postgres
depends_on:
- postgres
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=${THICC_DB}
- POSTGRES_USER=${THICC_USER}
- POSTGRES_PASSWORD=${THICC_PASSWORD}
- SCHEDULE=@daily
- BACKUP_KEEP_DAYS=7
- BACKUP_KEEP_WEEKS=4
- BACKUP_KEEP_MONTHS=6
# - HEALTHCHECK_PORT=80
flask:
image: jrmurray/thiccbot-flask:latest
tty: true
environment:
- DB_USER=${THICC_USER}
- DB_PASS=${THICC_PASSWORD}
- DB_NAME=${THICC_DB}
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
- DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
- BOT_API_TOKEN=${BOT_API_TOKEN}
- SECRET_KEY=${FLASK_SECRET_KEY}
- LAST_FM_API_KEY=${LAST_FM_API_KEY}
- LAST_FM_SECRET=${LAST_FM_SECRET}
- FLASK_APP=src
- FLASK_ENV=production
depends_on:
- postgres
restart: always
# run this command when you change db models, this does not detect all changes https://flask-migrate.readthedocs.io/en/latest/
# command: sh -c "dockerize -wait tcp://postgres:5432 && flask db migrate"
command: sh -c "dockerize -wait tcp://postgres:5432 && flask db upgrade && gunicorn -w 4 -b 0.0.0.0:8000 src:app" #&& flask db upgrade
# command: sh -c "ls "
bot:
tty: true
image: jrmurray/thiccbot-bot:latest
restart: always
environment:
- DISCORD_ID=${DISCORD_ID}
- BACKEND_URL=http://nginx/api
- BOT_API_TOKEN=${BOT_API_TOKEN}
- BOT_ADMIN=${BOT_ADMIN}
- BOT_ENV=production
depends_on:
- flask
command: python thiccBot/main.py
nginx:
image: jrmurray/thiccbot-nginx:latest
depends_on:
- flask
ports:
- "80:80"
# web:
# build: ./web
# tty: true
# environment:
# - PORT=4000
# ports:
# - "4000:4000"
# volumes:
# - ./web:/thiccweb:rw
# # - node_modules:/thiccweb/node_modules:rw
# command: bash -c "cd /thiccweb; rm -f .bsb.lock; npm run dev"
# # depends_on:
# # - flask