chore: initialize WiseGrade project
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
services:
|
||||
db:
|
||||
image: pgvector/pgvector:pg16
|
||||
environment:
|
||||
POSTGRES_DB: wisegrade
|
||||
POSTGRES_USER: wisegrade
|
||||
POSTGRES_PASSWORD: wisegrade
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, "pg_isready -U wisegrade"]
|
||||
interval: 5s
|
||||
retries: 12
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
api:
|
||||
build: ./backend
|
||||
env_file: .env
|
||||
volumes: &api-volumes
|
||||
- ${WISEGRADE_DATA_DIR}:/data/inbox:ro
|
||||
- ./data/processed:/data/processed
|
||||
- ./data/exports:/data/exports
|
||||
- ./models:/models:ro
|
||||
- ./docs:/app/course-docs:ro
|
||||
depends_on:
|
||||
db: {condition: service_healthy}
|
||||
redis: {condition: service_started}
|
||||
command: ["sh", "-c", "alembic upgrade head && uvicorn wisegrade.main:app --host 0.0.0.0 --port 8000"]
|
||||
healthcheck:
|
||||
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health')"]
|
||||
interval: 10s
|
||||
retries: 12
|
||||
worker:
|
||||
build: ./backend
|
||||
env_file: .env
|
||||
volumes: *api-volumes
|
||||
depends_on:
|
||||
db: {condition: service_healthy}
|
||||
redis: {condition: service_started}
|
||||
command: ["sh", "-c", "rq worker wisegrade --url \"$$REDIS_URL\""]
|
||||
web:
|
||||
build: ./frontend
|
||||
ports:
|
||||
- "127.0.0.1:8080:80"
|
||||
depends_on: [api]
|
||||
healthcheck:
|
||||
test: [CMD, wget, -q, -O, /dev/null, "http://127.0.0.1/health"]
|
||||
interval: 10s
|
||||
retries: 6
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user