https://github.com/CDSP-SCPO/metadata-middleware
Raw File
Tip revision: 9cf7c12739ec9987f4090f78426b9e7937efd25f authored by Baptiste Rouxel on 17 February 2023, 15:03:28 UTC
Create LICENSE
Tip revision: 9cf7c12
Dockerfile
FROM python:3.11-slim

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser

WORKDIR /app
COPY requirements.txt .
RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=appuser main.py .

USER appuser

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
back to top