Spaces:
Running
Running
axeronis commited on
Commit ·
ca78350
1
Parent(s): 8a6f7f5
chore: add root Dockerfile to fix deployment (switch from Nixpacks)
Browse files- .dockerignore +14 -0
- Dockerfile +34 -0
.dockerignore
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.gitignore
|
| 3 |
+
.env
|
| 4 |
+
.venv
|
| 5 |
+
frontend
|
| 6 |
+
node_modules
|
| 7 |
+
tests
|
| 8 |
+
htmlcov
|
| 9 |
+
__pycache__
|
| 10 |
+
*.pyc
|
| 11 |
+
*.pyo
|
| 12 |
+
.DS_Store
|
| 13 |
+
.vscode
|
| 14 |
+
.idea
|
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.11 slim image (matches project requirements)
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory to app root
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
# gcc: for compiling some python packages if needed
|
| 9 |
+
# ffmpeg: for pydub (audio processing)
|
| 10 |
+
# curl, libpq-dev: for postgres/healthchecks
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
gcc \
|
| 13 |
+
ffmpeg \
|
| 14 |
+
libpq-dev \
|
| 15 |
+
curl \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Copy backend requirements first for caching
|
| 19 |
+
COPY backend/requirements.txt ./backend/requirements.txt
|
| 20 |
+
|
| 21 |
+
# Install Python dependencies
|
| 22 |
+
RUN pip install --no-cache-dir -r backend/requirements.txt
|
| 23 |
+
|
| 24 |
+
# Copy the entire backend directory
|
| 25 |
+
COPY backend ./backend
|
| 26 |
+
|
| 27 |
+
# Set working directory to backend where app code lives
|
| 28 |
+
WORKDIR /app/backend
|
| 29 |
+
|
| 30 |
+
# Set environment variables
|
| 31 |
+
ENV PYTHONUNBUFFERED=1
|
| 32 |
+
|
| 33 |
+
# Run command (matches nixpacks.toml behavior)
|
| 34 |
+
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"]
|