itcloud/backend/Dockerfile

35 lines
730 B
Docker

FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
ffmpeg \
&& 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/
# Copy Alembic files for migrations
COPY alembic.ini ./
COPY alembic/ ./alembic/
# Create directory for SQLite database
RUN mkdir -p /app/data
ENV PYTHONPATH=/app/src
# Run migrations and start server
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]