Files
fluxer/docker/docker-compose.yml
T

94 lines
2.9 KiB
YAML

services:
bot:
build:
context: ..
dockerfile: docker/Dockerfile
args:
# Baked into the image so the bot can show a working commit link (the image has no .git).
GIT_SHA: ${GIT_SHA:-}
container_name: remix-bot
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nodelink:
condition: service_healthy
volumes:
- ./config.json:/app/config.json
- ../storage:/app/storage
environment:
- TZ=${TZ:-UTC}
# No ports: the bot runs no HTTP server (the dashboard talks to it over Redis).
networks:
- remix-net
mysql:
image: mysql:8.0
container_name: remix-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-remix_root_pw}
MYSQL_DATABASE: ${MYSQL_DATABASE:-remix}
MYSQL_USER: ${MYSQL_USER:-remix}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-remix_pw}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
# Password via MYSQL_PWD (not on the command line, so it is not visible in `ps` or warned about).
test: ["CMD-SHELL", "MYSQL_PWD=\"$$MYSQL_ROOT_PASSWORD\" mysqladmin ping -h localhost -u root"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- remix-net
redis:
image: redis:7-alpine
container_name: remix-redis
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- remix-net
nodelink:
# NodeLink is NOT published on npm: it is built from the official repository using its own
# Dockerfile. NODELINK_REF is a git tag or commit (v3.9.0 = commit cdb02c6814fd...).
# Configuration is done with NODELINK_* environment variables (see NodeLink's docker-compose.yml
# for the full list, e.g. cluster, logging and per-source settings).
build:
context: https://github.com/PerformanC/NodeLink.git#${NODELINK_REF:-v3.9.0}
dockerfile: Dockerfile
container_name: remix-nodelink
restart: unless-stopped
environment:
- TZ=${TZ:-UTC}
- NODELINK_SERVER_HOST=0.0.0.0
- NODELINK_SERVER_PORT=3000
- NODELINK_SERVER_PASSWORD=${NODELINK_PASSWORD:?Set NODELINK_PASSWORD in docker/.env (and the same value in config.json -> nodelink.password)}
# Reachable from the bot over the compose network only. It is deliberately NOT published on
# the host: anyone who can reach it with the password can use your server as an audio proxy.
expose:
- "3000"
healthcheck:
test: ["CMD", "node", "-e", "require('net').connect(3000,'127.0.0.1').on('connect',function(){process.exit(0)}).on('error',function(){process.exit(1)})"]
interval: 5s
timeout: 3s
retries: 30
start_period: 60s
networks:
- remix-net
volumes:
mysql_data:
networks:
remix-net:
driver: bridge