20 lines
No EOL
502 B
Docker
20 lines
No EOL
502 B
Docker
# Use newer, more secure base image
|
|
FROM python:3.13-alpine
|
|
|
|
# Update system packages first
|
|
RUN apk update && apk upgrade
|
|
|
|
# Install minimal dependencies
|
|
RUN apk add --no-cache mesa-gl
|
|
|
|
# Use specific package versions
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Run as non-root user
|
|
RUN adduser -D -s /bin/sh appuser
|
|
USER appuser
|
|
|
|
COPY . .
|
|
CMD ["python3", "-m", "fastapi", "run", "--host", "0.0.0.0", "--port", "8000"] |