# Use the official FastAPI image with Python 3.9 | |
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9 | |
# Set the working directory | |
WORKDIR /app | |
# Copy requirements and install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the application code | |
COPY . . | |
# Set environment variables | |
ENV APP_SECRET=your_app_secret_here | |
# Expose the port | |
EXPOSE 8001 | |
# Run the application | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"] | |