Files
cbwebreader/docker-compose.yml
ajurna a9e9bfb480 **Improve database handling and disable redundant health checks**
- Added logic to construct `DATABASE_URL` from `DB_*` variables to prevent accidental fallback to SQLite during Docker Compose deployments.
- Updated `DATABASES` configuration to use `dj_database_url.parse` instead of deprecated `config`.
- Disabled health checks for services that do not expose a web port to avoid unnecessary probes.
- Removed unused `libmariadb-dev` and `pkg-config` dependencies from the `Dockerfile`.
2026-10-14 12:32:11 +01:00

73 lines
1.7 KiB
YAML

services:
cbwebreader:
build: .
image: ajurna/cbwebreader
env_file: .env
depends_on:
database:
condition: service_healthy
expose:
- 8000
volumes:
# COMIC_BOOK_VOLUME is the path *inside* the container; the host path is
# a separate variable so a Windows host path is not passed to Django.
- ${COMIC_BOOK_HOST_PATH}:${COMIC_BOOK_VOLUME}
- static_files:/static
- media_files:/media
- .env:/src/.env
command: sh entrypoint.sh
restart: unless-stopped
cbwebreader-cron:
build: .
image: ajurna/cbwebreader
env_file: .env
depends_on:
database:
condition: service_healthy
volumes:
- ${COMIC_BOOK_HOST_PATH}:${COMIC_BOOK_VOLUME}
- media_files:/media
- .env:/src/.env
# The image HEALTHCHECK probes the web port, which this service never serves.
healthcheck:
disable: true
command: sh entrypoint-cron.sh
restart: unless-stopped
database:
image: postgres:16-alpine
expose:
- 5432
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 10s
retries: 3
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_DATABASE}
restart: unless-stopped
nginx:
image: nginx:1-alpine
volumes:
- static_files:/static
- media_files:/media
- ./compose/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "${WEB_PORT:-8337}:80"
depends_on:
cbwebreader:
condition: service_healthy
restart: unless-stopped
volumes:
static_files:
media_files:
postgres_data: