Compare commits

...

6 Commits

Author SHA1 Message Date
renovate[bot]
aed4cc21f7 Merge 5d9103960d into e77fe115c6 2024-11-24 20:16:23 +00:00
renovate[bot]
5d9103960d feat(deps): update dependency mako to v1.3.6 2024-11-24 20:16:20 +00:00
e77fe115c6 fix: removed duplicate install 2024-11-24 17:16:23 +01:00
6ab1eafe1d fix: fixed security recommendation from codacy 2024-11-24 17:16:11 +01:00
256e2adbf7 fix: fixed a recommendation from codacy 2024-11-24 17:13:44 +01:00
7c0d0da511 fix: bumped security dependency 2024-11-24 17:13:33 +01:00
2 changed files with 18 additions and 6 deletions

View File

@@ -1,9 +1,15 @@
FROM python:3.12-slim
ARG VERSION=unkown
ARG VERSION=unknown
# Create a non-root user and group
RUN groupadd -r appuser && useradd -r -g appuser appuser
WORKDIR /app
COPY . .
# Change ownership of the application directory
RUN chown -R appuser:appuser /app
# Python setup
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
@@ -12,13 +18,19 @@ ENV ENV=DEV
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN pip install 'uvicorn[standard]'
# Switch to the non-root user
USER appuser
EXPOSE 9000
CMD ["uvicorn", "app.main:app", "--workers", "6" , "--host", "0.0.0.0", "--port", "9000"]
# Install curl
RUN apt-get update && apt-get install -y curl && apt-get clean
USER root
RUN apt-get update && apt-get install -y --no-install-recommends curl && apt-get clean
# Switch back to the non-root user
USER appuser
HEALTHCHECK --interval=30s --timeout=10s --retries=5 \
CMD curl --fail http://localhost:9000/openapi.json || exit 1

View File

@@ -2,7 +2,7 @@ annotated-types==0.7.0
anyio==4.6.2.post1
certifi==2024.8.30
creyPY==1.2.5
fastapi==0.115.0
fastapi==0.115.5
fastapi-pagination==0.12.31
h11==0.14.0
httpcore==1.0.6
@@ -16,10 +16,10 @@ pydantic_core==2.23.4
python-dotenv==1.0.1
sniffio==1.3.1
SQLAlchemy==2.0.35
starlette==0.38.6
starlette==0.40.0
typing_extensions==4.12.2
Mako==1.3.5 # Alembic
Mako==1.3.6 # Alembic
MarkupSafe==3.0.1 # Alembic
alembic==1.13.3 # Alembic