-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
docker-compose.yml
135 lines (125 loc) · 2.87 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# SPDX-FileCopyrightText: 2023 Joonas Rautiola <joinemm@pm.me>
# SPDX-License-Identifier: MPL-2.0
# https://git.joinemm.dev/miso-bot
services:
nginx:
image: nginx:latest
container_name: miso-nginx
restart: unless-stopped
volumes:
- ./infra/nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt/:/etc/letsencrypt/
ports:
- 80:80
- 443:443
profiles: [prod]
db:
container_name: miso-db
image: mariadb
restart: unless-stopped
volumes:
- database:/var/lib/mysql
- ./sql/init:/docker-entrypoint-initdb.d:ro
- ./sql/scheduled:/scripts:ro
ports:
- 3306:3306
environment:
- MARIADB_USER=bot
- MARIADB_PASSWORD=botpw
- MARIADB_DATABASE=misobot
- MARIADB_ROOT_PASSWORD=secure-af
profiles: [prod, dev, dev-extra]
image-server:
container_name: miso-image-server
build: https://github.com/joinemm/sushii-image-server.git#main
restart: unless-stopped
init: true
cap_add:
- SYS_ADMIN
expose:
- 3000
volumes:
- ./static:/app/static:ro
- ./templates:/app/templates:ro
profiles: [prod, dev-extra]
shlink:
container_name: miso-shlink
image: shlinkio/shlink:latest
restart: unless-stopped
expose:
- 8080
environment:
- DEFAULT_DOMAIN=url.misobot.xyz
- IS_HTTPS_ENABLED=true
- DB_DRIVER=maria
- DB_NAME=shlink
- DB_USER=bot
- DB_PASSWORD=botpw
- DB_HOST=db
depends_on:
- db
profiles: [prod, dev-extra]
emojifier:
container_name: miso-emojifier
build: https://github.com/joinemm/emojify.git#backend
restart: unless-stopped
expose:
- 3000
profiles: [prod, dev-extra]
bot-prod:
container_name: miso-bot
build: .
command: python -O main.py
restart: unless-stopped
expose:
- 8080
depends_on:
- db
env_file:
- .env
environment:
- DB_HOST=miso-db
- IMAGE_SERVER_HOST=image-server
- EMOJIFIER_HOST=emojifier
- WEBSERVER_PORT=8080
- WEBSERVER_HOSTNAME=0.0.0.0
- USE_REDIS_CACHE=1
tty: true
profiles: [prod]
bot-dev:
container_name: miso-bot-dev
build: .
command: python -O main.py dev
restart: unless-stopped
expose:
- 8080
depends_on:
- db
env_file:
- .env
environment:
- DB_HOST=miso-db
- IMAGE_SERVER_HOST=image-server
- EMOJIFIER_HOST=emojifier
- WEBSERVER_PORT=8080
- WEBSERVER_HOSTNAME=0.0.0.0
- USE_REDIS_CACHE=1
tty: true
profiles: [dev, dev-extra]
redis:
container_name: miso-redis
image: "redis:alpine"
environment:
- REDIS_REPLICATION_MODE=master
expose:
- 6379
volumes:
- redis-data:/data
profiles: [prod, dev-extra]
networks:
default:
driver: bridge
volumes:
database:
shlink-database:
redis-data: