mrmBot-Matrix/docker-compose.yml
samhza c00d518f6e
simplify postgres and sqlite database initialization, remove psqlinit.sh (#331)
Before this change, uninitialized databases would be initialized with the old
schema and then migrated to the latest version. After this change, unintialized
databases are initizialized with the latest database schema immediately, without
having to run any of the migrations. This change has no effect on existing
databases.

Before this change, Postgres database initialization was done manually using
utils/psqlinit.sh. This is inconsistent with SQLite, which the bot initializes
itself. It also requires shell access to the server running the Postgres
instance, which means it cannot be used on managed Postgres instances. After
this change, the bot initializes Postgres databases as it does with SQLite, and
utils/psqlinit.sh has been removed as it is now unecessary.
2022-11-26 15:31:00 -06:00

84 lines
No EOL
1.8 KiB
YAML

version: '3.0'
services:
bot:
build:
context: .
image: esmbot
restart: unless-stopped
volumes:
- ./logs:/home/esmBot/.internal/logs
- ./bot-help:/home/esmBot/help
- ./bot-temp:/home/esmBot/temp
- ./config:/home/esmBot/.internal/config
env_file:
- .env
environment:
OUTPUT: /home/esmBot/help/help.md
TEMPDIR: /home/esmBot/temp
user: root
links:
- lavalink
depends_on:
lavalink:
condition: service_healthy
postgres:
condition: service_started
networks:
esmbot:
ipv4_address: 172.20.0.2
lavalink:
container_name: lavalink
image: fredboat/lavalink:dev
restart: unless-stopped
volumes:
- ./application.yml:/opt/Lavalink/application.yml
- ./assets:/opt/Lavalink/assets
healthcheck:
test: "curl -H \"Authorization: $$(cat /opt/Lavalink/application.yml | grep password: | sed 's/^ *password: //g' | tr -d '\"')\" -f http://localhost:2333/version"
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
networks:
esmbot:
ipv4_address: 172.20.0.3
postgres:
container_name: postgres
image: postgres:13-alpine
restart: unless-stopped
volumes:
- pg-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: verycoolpass100
POSTGRES_USER: esmbot
POSTGRES_DB: esmbot
networks:
esmbot:
ipv4_address: 172.20.0.4
adminer:
image: adminer
restart: unless-stopped
depends_on:
- postgres
ports:
- 8888:8080
networks:
esmbot:
ipv4_address: 172.20.0.5
volumes:
bot-help:
bot-temp:
pg-data:
networks:
esmbot:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24