language-learning-app/api/Dockerfile

26 lines
724 B
Docker
Raw Normal View History

FROM python:3.13-slim
2026-03-18 20:55:02 +00:00
WORKDIR /app
# Install uv for fast, reproducible installs
RUN pip install --no-cache-dir uv alembic
2026-03-18 20:55:02 +00:00
# Install Python dependencies from pyproject.toml
COPY pyproject.toml .
RUN uv pip install --system --no-cache .
# Download spaCy language models
RUN python -m spacy download en_core_web_sm && \
python -m spacy download fr_core_news_sm && \
python -m spacy download es_core_news_sm && \
python -m spacy download it_core_news_sm && \
python -m spacy download de_core_news_sm
# Copy application source and migrations
2026-03-18 20:55:02 +00:00
COPY app/ ./app/
COPY alembic/ ./alembic/
COPY alembic.ini .
2026-03-18 20:55:02 +00:00
EXPOSE 8000
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]