feat: add stage 0 foundation

This commit is contained in:
hailin
2026-06-30 15:55:46 +08:00
parent 6d373da09f
commit 604f456e03
68 changed files with 4884 additions and 0 deletions

13
infra/backend.Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY backend/pyproject.toml /app/pyproject.toml
RUN pip install --no-cache-dir -e ".[dev]"
COPY backend /app
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

72
infra/docker-compose.yml Normal file
View File

@@ -0,0 +1,72 @@
services:
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ${POSTGRES_DB:-ai_ticket_platform}
POSTGRES_USER: ${POSTGRES_USER:-ai_ticket}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ai_ticket}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
ports:
- "6379:6379"
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minio}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minio123}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
backend:
build:
context: ..
dockerfile: infra/backend.Dockerfile
env_file:
- path: ../.env
required: false
ports:
- "8000:8000"
depends_on:
- postgres
- redis
volumes:
- ../backend:/app
worker:
build:
context: ..
dockerfile: infra/backend.Dockerfile
env_file:
- path: ../.env
required: false
command: celery -A config.celery worker -l info
depends_on:
- backend
- redis
volumes:
- ../backend:/app
frontend:
build:
context: ..
dockerfile: infra/frontend.Dockerfile
ports:
- "5173:5173"
volumes:
- ../frontend:/app
- frontend-node-modules:/app/node_modules
volumes:
postgres-data:
minio-data:
frontend-node-modules:

10
infra/frontend.Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM node:22-slim
WORKDIR /app
COPY frontend/package.json /app/package.json
RUN npm install
COPY frontend /app
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]