codereview-env / Dockerfile
SyamSashank's picture
Update Dockerfile
9373355 verified
raw
history blame contribute delete
603 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Create a non-root user for security
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Copy and install dependencies
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY --chown=user:user . .
# Standard OpenEnv port is 8000
EXPOSE 7860
# Start using uvicorn on port 8000
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]