mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 10:36:55 +00:00
**Refactor Docker and Compose for enhanced compatibility and efficiency**
- Restructured `Dockerfile` to include a dedicated frontend build stage and improved runtime configurations. - Added new health checks and adjusted environment variables for better container management. - Updated cron job configurations to leverage `/opt/venv` and align with new paths. - Refined `docker-compose` files for multi-service setups, including better volume and environment variable handling. - Migrated `cbwebreader-cron` service setup and improved restart policies across the board. - Enhanced `.gitea` CI workflow to use updated tools (`uv`), streamline buildx processes, and ensure proper version extraction from metadata.
This commit is contained in:
1 parent
9b9db755e6
commit
147a3a54ef
9 files changed
+122
-92
No files matched your search
+32
-28
@@ -1,65 +1,69 @@
|
||||
version: "2.4"
|
||||
|
||||
services:
|
||||
|
||||
cbwebreader:
|
||||
build: .
|
||||
image: ajurna/cbwebreader
|
||||
env_file: .env
|
||||
links:
|
||||
- database
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
expose:
|
||||
- 8000
|
||||
volumes:
|
||||
# - ${COMIC_BOOK_VOLUME}:/comics
|
||||
- c:/comics:/comics
|
||||
# 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: /bin/bash /src/entrypoint.sh
|
||||
command: sh entrypoint.sh
|
||||
restart: unless-stopped
|
||||
|
||||
# cbwebreader-cron:
|
||||
# build: .
|
||||
# env_file: .env
|
||||
# links:
|
||||
# - database
|
||||
# depends_on:
|
||||
# database:
|
||||
# condition: service_healthy
|
||||
# volumes:
|
||||
# - ${COMIC_BOOK_VOLUME}:${COMIC_BOOK_VOLUME}
|
||||
# - media_files:/media
|
||||
# - .env:/src/.env
|
||||
# command: /bin/bash entrypoint-cron.sh
|
||||
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
|
||||
command: sh entrypoint-cron.sh
|
||||
restart: unless-stopped
|
||||
|
||||
database:
|
||||
image: postgres:16-alpine
|
||||
expose:
|
||||
- 5432
|
||||
volumes:
|
||||
- /var/lib/postgresql/data
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $DB_USER -d $DB_DATABASE"]
|
||||
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}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASS}
|
||||
POSTGRES_DB: ${DB_DATABASE}
|
||||
restart: unless-stopped
|
||||
|
||||
nginx:
|
||||
image: nginx
|
||||
image: nginx:1-alpine
|
||||
volumes:
|
||||
- static_files:/static
|
||||
- media_files:/media
|
||||
- ./cbreader/settings/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- 8337:80
|
||||
- "${WEB_PORT:-8337}:80"
|
||||
depends_on:
|
||||
- cbwebreader
|
||||
cbwebreader:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
static_files:
|
||||
media_files:
|
||||
postgres_data:
|
||||
Reference in new issue
Block a user