feat(booklore): add traefik and homepage labels
This commit is contained in:
@@ -1,51 +1,71 @@
|
|||||||
services:
|
services:
|
||||||
booklore:
|
booklore:
|
||||||
image: booklore/booklore:latest
|
image: booklore/booklore:latest
|
||||||
|
# Alternative: Use GitHub Container Registry
|
||||||
|
# image: ghcr.io/booklore-app/booklore:latest
|
||||||
container_name: booklore
|
container_name: booklore
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
- mariadb
|
|
||||||
environment:
|
environment:
|
||||||
- TZ=Etc/UTC
|
- USER_ID=${APP_USER_ID}
|
||||||
- DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore
|
- GROUP_ID=${APP_GROUP_ID}
|
||||||
- DATABASE_USERNAME=${BOOKLORE_DB_USER:-booklore}
|
- TZ=${TZ}
|
||||||
- DATABASE_PASSWORD=${BOOKLORE_DB_PASSWORD}
|
- DATABASE_URL=${DATABASE_URL}
|
||||||
|
- DATABASE_USERNAME=${DB_USER}
|
||||||
|
- DATABASE_PASSWORD=${DB_PASSWORD}
|
||||||
|
- BOOKLORE_PORT=${BOOKLORE_PORT}
|
||||||
|
depends_on:
|
||||||
|
mariadb:
|
||||||
|
condition: service_healthy
|
||||||
|
expose:
|
||||||
|
- "${BOOKLORE_PORT}"
|
||||||
|
labels:
|
||||||
|
# Traefik
|
||||||
|
traefik.enable: "true"
|
||||||
|
traefik.http.routers.booklore.rule: "Host(`booklore.${DOMAIN}`)"
|
||||||
|
traefik.http.routers.booklore.entrypoints: "https"
|
||||||
|
traefik.http.routers.booklore.tls.certresolver: "cloudflare"
|
||||||
|
traefik.http.routers.booklore.service: "booklore"
|
||||||
|
traefik.http.services.booklore.loadbalancer.server.port: "${BOOKLORE_PORT}"
|
||||||
|
# Homepage
|
||||||
|
homepage.group: "Books"
|
||||||
|
homepage.name: "BookLore"
|
||||||
|
homepage.icon: "booklore.png"
|
||||||
|
homepage.href: "https://booklore.${DOMAIN}"
|
||||||
|
homepage.description: "Book Manager"
|
||||||
|
networks:
|
||||||
|
- traefik_public
|
||||||
|
- default
|
||||||
volumes:
|
volumes:
|
||||||
- ${CONFIG_ROOT}/booklore/data:/app/data
|
- ${CONFIG_ROOT}/booklore/data:/app/data
|
||||||
- ${MEDIA_PATH}/books:/books
|
- ${MEDIA_PATH}/books:/books
|
||||||
- ${MEDIA_PATH}/bookdrop:/bookdrop
|
- ${MEDIA_PATH}/bookdrop:/bookdrop
|
||||||
labels:
|
healthcheck:
|
||||||
- "traefik.enable=true"
|
test: wget -q -O - http://localhost:${BOOKLORE_PORT}/api/v1/healthcheck
|
||||||
- "traefik.docker.network=traefik_public"
|
interval: 60s
|
||||||
- "traefik.http.routers.booklore.rule=Host(`booklore.${DOMAIN}`)"
|
retries: 5
|
||||||
- "traefik.http.routers.booklore.entrypoints=https"
|
start_period: 60s
|
||||||
- "traefik.http.routers.booklore.tls.certresolver=cloudflare"
|
timeout: 10s
|
||||||
- "traefik.http.services.booklore.loadbalancer.server.port=8080"
|
restart: unless-stopped
|
||||||
- "homepage.group=Books"
|
|
||||||
- "homepage.name=Booklore"
|
|
||||||
- "homepage.icon=booklore.png"
|
|
||||||
- "homepage.href=https://booklore.${DOMAIN}"
|
|
||||||
- "homepage.description=eBook Manager"
|
|
||||||
networks:
|
|
||||||
- traefik_public
|
|
||||||
- internal
|
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
image: mariadb:10.6
|
image: lscr.io/linuxserver/mariadb:11.4.5
|
||||||
container_name: booklore-mariadb
|
container_name: mariadb
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
environment:
|
||||||
- MARIADB_ROOT_PASSWORD=${BOOKLORE_DB_ROOT_PASSWORD}
|
- PUID=${DB_USER_ID}
|
||||||
- MARIADB_DATABASE=booklore
|
- PGID=${DB_GROUP_ID}
|
||||||
- MARIADB_USER=${BOOKLORE_DB_USER:-booklore}
|
- TZ=${TZ}
|
||||||
- MARIADB_PASSWORD=${BOOKLORE_DB_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
|
- MYSQL_USER=${DB_USER}
|
||||||
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- ${CONFIG_ROOT}/booklore/db:/var/lib/mysql
|
- ./mariadb/config:/config
|
||||||
networks:
|
restart: unless-stopped
|
||||||
- internal
|
healthcheck:
|
||||||
|
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik_public:
|
traefik_public:
|
||||||
external: true
|
external: true
|
||||||
internal:
|
|
||||||
driver: bridge
|
|
||||||
|
|||||||
Reference in New Issue
Block a user