Sign inSign up

33331111/question-memorization-app:latest

Manifest digest

sha256:86cd56c1cd81274c2d1d12b6054bacda15bd2ab8636dda66db870d96c922f423

Last pushed

about 1 month by 33331111

Type

Compose

Manifest digest

sha256:86cd56c1cd81274c2d1d12b6054bacda15bd2ab8636dda66db870d96c922f423

Compose file content

# Full-stack orchestration for Question-Mem-App.
#
# One command brings up everything: PostgreSQL, Redis, MinIO, FastAPI backend,
# Celery worker, and the Nginx-served React frontend.
#
#   cp .env.example .env   # first-time only — edit secrets before production
#   docker compose up --build
#
# Services:
#   postgres  — primary database (pg_trgm enabled via init.sql)
#   redis     — Celery broker/backend + cache
#   minio     — S3-compatible object storage for uploaded question-bank files
#   backend   — FastAPI (runs Alembic migrations on startup, then uvicorn)
#   worker    — Celery worker (shares image with backend, overrides command)
#   frontend  — Vite-built React app served by Nginx, proxies /api/ → backend

services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: question_mem
      POSTGRES_PASSWORD: question_mem_pass
      POSTGRES_DB: question_mem
    volumes:
      - pgdata:/var/lib/postgresql/data
      - ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U question_mem"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  minio:
    image: minio/minio
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - minio_data:/data
    # MinIO 镜像基于 distroless,无 curl/wget。
    # backend 在请求 MinIO 失败时会自动重试,service_started 已足够。
    restart: unless-stopped

  backend:
    build: ./backend
    # entrypoint.sh waits for postgres, runs alembic upgrade, then execs uvicorn.
    image: 33331111/question-mem-app-backend:tagname
    ports:
      - "8000:8000"
    env_file:
      - .env
    environment:
      # Marker so alembic env.py keeps the "postgres" service-name hostname
      # instead of rewriting it to 127.0.0.1 (which only works on the host).
      ALEMBIC_IN_DOCKER: "1"
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      minio:
        condition: service_started
    restart: unless-stopped

  worker:
    build: ./backend
    # Override the backend entrypoint — workers don't run migrations.
    # Celery config (timeouts, acks_late) is set in app/workers/celery_app.py.
    image: 33331111/question-mem-app-worker:tagname
    entrypoint: []
    # --concurrency=1: local LLM backends (llama.cpp, Ollama) can't handle
    # parallel requests well — concurrent calls exhaust the context window
    # and return 500 "Context size has been exceeded". Serializing keeps
    # each call's KV cache isolated and stable.
    command: celery -A app.workers.celery_app worker --loglevel=info --concurrency=1
    env_file:
      - .env.example
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      minio:
        condition: service_started
    restart: unless-stopped

  frontend:
    build: ./frontend
    image: 33331111/question-mem-app-frontend:tagname
    ports:
      - "3000:80"
    depends_on:
      - backend
    restart: unless-stopped

volumes:
  pgdata:
  minio_data:

Docker commands

docker compose -f oci://33331111/question-memorization-app:latest up

Use the above command to pull and run the Compose file. Learn more.

Images used

Image + 1 more

The PostgreSQL object-relational database system provides reliability and data integrity.


Pulls

1B+

Stars

15018

Last Updated

1 day

Image + 1 more

Redis is the world’s fastest data platform for caching, vector search, and NoSQL databases.


Pulls

1B+

Stars

13617

Last Updated

1 day

Image


Pulls

161

Stars

0

Last Updated

16 days

Image


Pulls

157

Stars

0

Last Updated

16 days

Image


Pulls

133

Stars

0

Last Updated

16 days