feat(docker): add Docker Compose deployment for Dokploy
- backend/Dockerfile: Python 3.12-slim, uvicorn on port 8000 - frontend/Dockerfile: multi-stage Node build + nginx:alpine serve - frontend/nginx.conf: proxy /api to backend, SPA routing for Vue Router - docker-compose.yml: backend+frontend services with Traefik labels - fix(cors): use settings.frontend_url instead of hardcoded localhost Fixes Nixpacks detection failure (requirements.txt/package.json not at root). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
14
backend/Dockerfile
Normal file
14
backend/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p uploads
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
@@ -34,7 +34,7 @@ app = FastAPI(title=settings.app_name)
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:5173"], # Frontend dev server
|
||||
allow_origins=[settings.frontend_url, "http://localhost:5173"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
Reference in New Issue
Block a user