Compare commits

...

14 Commits
1.0.4 ... 1.1.5

3 changed files with 22 additions and 7 deletions

View File

@@ -7,11 +7,16 @@ on:
- master
paths-ignore:
- "**/.gitignore"
- "**/.renovate.json"
- "**/.vscode/**"
- "**/README.md"
- "**/CHANGELOG.md"
- "**/docs/**"
workflow_dispatch:
pull_request:
branches:
- master
- dev
env:
REGISTRY: ghcr.io
@@ -51,6 +56,7 @@ jobs:
tag:
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write # for the tags
@@ -86,6 +92,7 @@ jobs:
run: git push origin ${{ steps.git_version.outputs.version }}
build_and_push:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions: write-all
needs: tag

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

View File

@@ -1,12 +1,12 @@
certifi==2024.7.4 # Testing
certifi==2024.8.30 # Testing
iniconfig==2.0.0 # PyTest Testing
packaging==23.2 # PyTest Testing
pluggy==1.3.0 # PyTest Testing
pytest==7.4.3 # PyTest Testing
pluggy==1.5.0 # PyTest Testing
pytest==7.4.4 # PyTest Testing
click==8.1.7 # Uvicorn
httptools==0.6.4 # Uvicorn
pyyaml==6.0.1 # Uvicorn
pyyaml==6.0.2 # Uvicorn
uvicorn==0.27.0.post1 # Uvicorn
uvloop==0.19.0 # Uvicorn
watchfiles==0.21.0 # Uvicorn