robertthecreator's picture
Upload 3 files
531d852 verified
Raw
History Blame Contribute Delete
523 Bytes
# Use Python 3.11 slim image
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y git wget && rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m appuser
USER appuser
# Set working directory
WORKDIR /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app files
COPY . .
# Expose port 8000 for FastAPI
EXPOSE 8000
# Start FastAPI server
CMD ["python", "app.py"]