Files
meme-wrangler/docker-compose.yml

53 lines
1.6 KiB
YAML

x-env-file: &compose_env_file ${COMPOSE_ENV_FILE:-.ENV}
services:
postgres:
image: postgres:15
container_name: meme-wrangler-db
restart: unless-stopped
env_file:
- *compose_env_file
environment:
- POSTGRES_DB=${POSTGRES_DB:-meme_wrangler}
- POSTGRES_USER=${POSTGRES_USER:-meme}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-meme}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-meme} -d ${POSTGRES_DB:-meme_wrangler}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
meme-wrangler:
build: .
container_name: meme-wrangler
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
env_file:
- *compose_env_file
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
- OWNER_ID=${OWNER_ID:-}
- CHANNEL_ID=${CHANNEL_ID:-}
- POSTGRES_DB=${POSTGRES_DB:-meme_wrangler}
- POSTGRES_USER=${POSTGRES_USER:-meme}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-meme}
- POSTGRES_HOST=${POSTGRES_HOST:-postgres}
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
- DATABASE_URL=${DATABASE_URL:-postgresql://${POSTGRES_USER:-meme}:${POSTGRES_PASSWORD:-meme}@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-meme_wrangler}}
- MEMEBOT_BACKUP_DIR=${MEMEBOT_BACKUP_DIR:-/app/backups}
volumes:
- ./backups:/app/backups
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
pgdata: