71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
services:
|
|
database:
|
|
image: mysql:8.0
|
|
restart: always
|
|
command: --log-bin-trust-function-creators=1
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: reminders
|
|
MYSQL_USER: reminder-bot
|
|
MYSQL_PASSWORD: password
|
|
volumes:
|
|
- reminders:/var/lib/mysql
|
|
|
|
bot:
|
|
build:
|
|
context: .
|
|
dockerfile: Containerfile.run
|
|
image: reminder-rs-run
|
|
restart: always
|
|
depends_on:
|
|
- database
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: "mysql://reminder-bot:password@database/reminders"
|
|
DISCORD_TOKEN:
|
|
PATREON_GUILD_ID:
|
|
PATREON_ROLE_ID:
|
|
LOCAL_TIMEZONE:
|
|
MIN_INTERVAL:
|
|
ROCKET_SECRET_KEY:
|
|
ROCKET_ADDRESS: "0.0.0.0"
|
|
ROCKET_PORT: "18920"
|
|
REMIND_INTERVAL:
|
|
OAUTH2_DISCORD_CALLBACK:
|
|
OAUTH2_CLIENT_ID:
|
|
OAUTH2_CLIENT_SECRET:
|
|
|
|
ports:
|
|
- "18920:18920"
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
restart: always
|
|
depends_on:
|
|
- bot
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/selfsigned.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- nginx_certs:/etc/nginx/certs
|
|
entrypoint:
|
|
- "/bin/sh"
|
|
- "-c"
|
|
command: |
|
|
set -e
|
|
apk add --no-cache openssl
|
|
mkdir -p /etc/nginx/certs
|
|
if [ ! -f /etc/nginx/certs/selfsigned.key ] || [ ! -f /etc/nginx/certs/selfsigned.crt ]; then
|
|
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
|
-keyout /etc/nginx/certs/selfsigned.key \
|
|
-out /etc/nginx/certs/selfsigned.crt \
|
|
-subj "/CN=localhost"
|
|
fi
|
|
exec nginx -g 'daemon off;'
|
|
|
|
volumes:
|
|
reminders:
|
|
nginx_certs:
|