Spaces:
Sleeping
Sleeping
# Use the official Python image from the Docker Hub | |
FROM python:3.10-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Install Poetry | |
RUN pip install poetry | |
# Copy only the pyproject.toml and poetry.lock files to install dependencies first | |
COPY pyproject.toml poetry.lock ./ | |
# Install dependencies using Poetry | |
RUN poetry config virtualenvs.create false && poetry install --only=main | |
# Copy the rest of the application code to the working directory | |
COPY . . | |
# Expose the port FastAPI will run on | |
EXPOSE 8000 | |
# Command to run the FastAPI application | |
CMD ["poetry", "run", "uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] |