Tagging v* builds both images on Gitea Actions and pushes them to the instance registry, then smoke-tests the published stack. The frontend read its backend URL through import.meta.env, which Vite resolves at build time, so an image could only point at whatever the build host had; it now reads it at runtime.
90 lines
1.8 KiB
YAML
90 lines
1.8 KiB
YAML
---
|
|
services:
|
|
db:
|
|
image: postgres:17
|
|
|
|
networks:
|
|
- backend-network
|
|
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
POSTGRES_USER: ${CHITAI_POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${CHITAI_POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${CHITAI_POSTGRES_DB}
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${CHITAI_POSTGRES_USER} -d ${CHITAI_POSTGRES_DB}"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
|
|
backend:
|
|
image: git.jaroszew.ski/patrick/chitai-backend:${CHITAI_VERSION:-latest}
|
|
|
|
# Only used when the image above is not present locally. Run `docker compose build` to
|
|
# build from source instead of pulling a release.
|
|
build: ./backend
|
|
|
|
networks:
|
|
- backend-network
|
|
- frontend-network
|
|
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
volumes:
|
|
# Bind mount your libraries into /app/libraries/
|
|
# - ./books:/app/libraries/books
|
|
# ...
|
|
# Or bind mount entire libraries folder
|
|
- ./libraries:/app/libraries
|
|
|
|
# Mount book covers directory
|
|
- book_covers:/app/covers
|
|
|
|
restart: unless-stopped
|
|
|
|
env_file:
|
|
- .env
|
|
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
frontend:
|
|
image: git.jaroszew.ski/patrick/chitai-frontend:${CHITAI_VERSION:-latest}
|
|
|
|
build: ./frontend
|
|
|
|
networks:
|
|
- frontend-network
|
|
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
VITE_BACKEND_API_URL: ${CHITAI_API_URL}
|
|
|
|
# Must match the URL the browser uses, or SvelteKit rejects form POSTs as cross-origin.
|
|
ORIGIN: ${CHITAI_ORIGIN:-http://localhost:3000}
|
|
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
postgres_data:
|
|
book_covers:
|
|
|
|
networks:
|
|
frontend-network:
|
|
backend-network:
|
|
|