itcloud/backend/Dockerfile

36 lines
746 B
Docker
Raw Permalink Normal View History

2025-12-30 13:35:19 +01:00
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
2025-12-30 22:19:33 +01:00
ffmpeg \
2026-01-05 18:43:18 +01:00
libmagic1 \
2025-12-30 13:35:19 +01:00
&& rm -rf /var/lib/apt/lists/*
# Install poetry
RUN pip install poetry==1.7.1
# Copy dependency files
COPY pyproject.toml ./
# Install dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
# Copy application code
COPY src/ ./src/
2025-12-30 23:24:13 +01:00
# Copy Alembic files for migrations
COPY alembic.ini ./
COPY alembic/ ./alembic/
2025-12-30 13:35:19 +01:00
# Create directory for SQLite database
RUN mkdir -p /app/data
ENV PYTHONPATH=/app/src
2025-12-30 23:46:57 +01:00
# Run migrations and start server
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]