Compare commits

...

4 Commits
1.1.3 ... 1.1.5

Author SHA1 Message Date
35040f3c54 fix: fixed security concern 2024-11-24 17:24:05 +01:00
63abb64b4f fix: fixed codacy recommendation 2024-11-24 17:22:34 +01:00
730b57e8e8 fix: fixed codacy recommendation 2024-11-24 17:21:08 +01:00
3bb5bb6739 Update ci.yml 2024-11-24 16:14:54 +01:00
2 changed files with 12 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ on:
- master
paths-ignore:
- "**/.gitignore"
- "**/.renovate.json"
- "**/.vscode/**"
- "**/README.md"
- "**/CHANGELOG.md"

View File

@@ -1,5 +1,8 @@
FROM python:3.12-slim
ARG VERSION=unkown
ARG VERSION=unknown
# Create a non-root user
RUN useradd appuser
WORKDIR /app
COPY . .
@@ -11,15 +14,20 @@ ENV VERSION=${VERSION}
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN pip install 'uvicorn[standard]'
ENV ENV=DEV
# Switch to non-root user
USER appuser
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
# Install curl
RUN apt-get update && apt-get install -y curl && apt-get clean
USER root
RUN apt-get update && apt-get install --no-install-recommends -y curl && apt-get clean
# Switch back to non-root user for healthcheck
USER appuser
HEALTHCHECK --interval=30s --timeout=10s --retries=5 \
CMD curl --fail http://localhost:8000/openapi.json || exit 1