26 lines
564 B
Docker
26 lines
564 B
Docker
# Base Image
|
|
FROM python:3.13
|
|
|
|
RUN pip install poetry
|
|
|
|
# Environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Set working directory
|
|
WORKDIR /app/
|
|
|
|
# Copy dependency files first to leverage caching
|
|
COPY pyproject.toml poetry.lock /app/
|
|
|
|
# Copy the rest of the application
|
|
COPY ./app /app/app
|
|
|
|
# Ensure dependencies are installed correctly
|
|
RUN poetry install --no-interaction --no-ansi --without dev
|
|
|
|
# Expose port for FastAPI
|
|
EXPOSE 8000
|
|
|
|
# Command to run the app
|
|
CMD ["poetry", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
|