Fix file management and permissions issues (#23)

This commit is contained in:
nol 2024-12-12 19:39:29 +01:00 committed by GitHub
parent 41a76f32d9
commit 9996a06a94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 118 additions and 4 deletions

View file

@ -2,9 +2,18 @@ FROM python:3.12
WORKDIR /app
# Create a non-root user
RUN useradd -m -u 1000 appuser
COPY src/ ./
COPY requirements.txt ./
RUN pip install -r requirements.txt
# Change ownership of the application files
RUN chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
CMD ["uvicorn", "main:app", "--reload"]