1b1217ace2
Build and Push Reader API Image / docker (push) Successful in 26s
chore(docker): remove MongoDB service and related configurations from local setup feat(migrations): create ChapterMeta table and add search_name, size_bytes, mtime_epoch, lastScannedAt, review_status, and review_payload columns to SourceAsset chore(dependencies): remove motor and pymongo from project dependencies
102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
services:
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: reader-api:latest
|
|
container_name: reader-api
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
NAS_CONTENT_ROOT: ${NAS_CONTENT_ROOT:-/data/content}
|
|
EPUB_SOURCE_ROOT: ${EPUB_SOURCE_ROOT:-/data/epub-source}
|
|
volumes:
|
|
- nas_chapter_content:/data/content
|
|
- nas_epub_source:/data/epub-source
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health').read()"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
|
|
# Local mode API: binds to local Postgres container.
|
|
api-local:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: reader-api:latest
|
|
container_name: reader-api-local
|
|
profiles: ["localdb"]
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: postgresql://reader:reader@postgres:5432/reader
|
|
NAS_CONTENT_ROOT: ${NAS_CONTENT_ROOT:-/data/content}
|
|
EPUB_SOURCE_ROOT: ${EPUB_SOURCE_ROOT:-/data/epub-source}
|
|
ports:
|
|
- "8001:8000"
|
|
volumes:
|
|
- nas_chapter_content:/data/content
|
|
- nas_epub_source:/data/epub-source
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health').read()"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
web:
|
|
build:
|
|
context: ../reader
|
|
dockerfile: Dockerfile
|
|
image: reader-web:latest
|
|
container_name: reader-web
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3000
|
|
READER_API_ORIGIN: http://api:8000
|
|
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
|
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
|
|
GOOGLE_CLIENT_ID: ${WEB_GOOGLE_CLIENT_ID}
|
|
GOOGLE_CLIENT_SECRET: ${WEB_GOOGLE_CLIENT_SECRET}
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- web_uploads:/app/public/uploads
|
|
restart: unless-stopped
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: reader-api-postgres
|
|
profiles: ["localdb"]
|
|
environment:
|
|
POSTGRES_DB: reader
|
|
POSTGRES_USER: reader
|
|
POSTGRES_PASSWORD: reader
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U reader -d reader"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
web_uploads:
|
|
postgres_data:
|
|
nas_chapter_content:
|
|
nas_epub_source:
|