mirror of
https://github.com/creyD/apilog.git
synced 2026-04-13 03:40:30 +02:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcec3079d3 | ||
|
|
cf033298ce | ||
|
|
3738b6f0a7 | ||
|
|
b8ac7226be | ||
| dafdf34f71 | |||
| e77fe115c6 | |||
| 6ab1eafe1d | |||
| 256e2adbf7 | |||
| 7c0d0da511 | |||
|
|
4f793585e5 | ||
|
|
98df462b61 | ||
| 6db2b3e14e | |||
| 22eaed8a75 |
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
- master
|
- master
|
||||||
|
- renovate/**
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**/.github/**"
|
- "**/.github/**"
|
||||||
- "**/.gitignore"
|
- "**/.gitignore"
|
||||||
@@ -13,6 +14,10 @@ on:
|
|||||||
- "**/CHANGELOG.md"
|
- "**/CHANGELOG.md"
|
||||||
- "**/docs/**"
|
- "**/docs/**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
- master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
|
|||||||
18
Dockerfile
18
Dockerfile
@@ -1,9 +1,15 @@
|
|||||||
FROM python:3.12-slim
|
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
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Change ownership of the application directory
|
||||||
|
RUN chown -R appuser:appuser /app
|
||||||
|
|
||||||
# Python setup
|
# Python setup
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
@@ -12,13 +18,19 @@ ENV ENV=DEV
|
|||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
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
|
EXPOSE 9000
|
||||||
CMD ["uvicorn", "app.main:app", "--workers", "6" , "--host", "0.0.0.0", "--port", "9000"]
|
CMD ["uvicorn", "app.main:app", "--workers", "6" , "--host", "0.0.0.0", "--port", "9000"]
|
||||||
|
|
||||||
# Install curl
|
# 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 \
|
HEALTHCHECK --interval=30s --timeout=10s --retries=5 \
|
||||||
CMD curl --fail http://localhost:9000/openapi.json || exit 1
|
CMD curl --fail http://localhost:9000/openapi.json || exit 1
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ async def get_logs(
|
|||||||
return paginate(db, order_by_query(the_select))
|
return paginate(db, order_by_query(the_select))
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/", status_code=200)
|
@router.delete("/", status_code=200, operation_id="log_delete_many")
|
||||||
async def delete_logs(
|
async def delete_logs(
|
||||||
application: UUID,
|
application: UUID,
|
||||||
environment: str | SkipJsonSchema[None] = None,
|
environment: str | SkipJsonSchema[None] = None,
|
||||||
|
|||||||
12
renovate.json
Normal file
12
renovate.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["config:recommended", ":semanticCommitTypeAll(feat)"],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"automerge": true,
|
||||||
|
"description": "Automerge non-major updates",
|
||||||
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
|
"automergeType": "branch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
anyio==4.6.0
|
anyio==4.6.2.post1
|
||||||
certifi==2024.8.30
|
certifi==2024.8.30
|
||||||
creyPY==1.2.5
|
creyPY==1.2.5
|
||||||
fastapi==0.115.0
|
fastapi==0.115.5
|
||||||
fastapi-pagination==0.12.31
|
fastapi-pagination==0.12.31
|
||||||
h11==0.14.0
|
h11==0.14.0
|
||||||
httpcore==1.0.6
|
httpcore==1.0.6
|
||||||
httpx==0.27.2
|
httpx==0.27.2
|
||||||
idna==3.10
|
idna==3.10
|
||||||
psycopg==3.2.3
|
psycopg==3.2.4
|
||||||
psycopg-binary==3.2.3
|
psycopg-binary==3.2.4
|
||||||
psycopg-pool==3.2.3
|
psycopg-pool==3.2.3
|
||||||
pydantic==2.9.2
|
pydantic==2.9.2
|
||||||
pydantic_core==2.23.4
|
pydantic_core==2.23.4
|
||||||
python-dotenv==1.0.1
|
python-dotenv==1.0.1
|
||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
SQLAlchemy==2.0.35
|
SQLAlchemy==2.0.35
|
||||||
starlette==0.38.6
|
starlette==0.40.0
|
||||||
typing_extensions==4.12.2
|
typing_extensions==4.12.2
|
||||||
|
|
||||||
Mako==1.3.5 # Alembic
|
Mako==1.3.5 # Alembic
|
||||||
@@ -25,12 +25,12 @@ alembic==1.13.3 # Alembic
|
|||||||
|
|
||||||
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
||||||
|
|
||||||
click==8.1.7 # Uvicorn
|
click==8.1.8 # Uvicorn
|
||||||
uvicorn==0.31.1 # Uvicorn
|
uvicorn==0.31.1 # Uvicorn
|
||||||
|
|
||||||
iniconfig==2.0.0 # pytest
|
iniconfig==2.0.0 # pytest
|
||||||
packaging==24.1 # pytest
|
packaging==24.1 # pytest
|
||||||
pluggy==1.5.0 # pytest
|
pluggy==1.5.0 # pytest
|
||||||
pytest==8.3.3 # pytest
|
pytest==8.3.4 # pytest
|
||||||
|
|
||||||
fastapi-filters==0.2.9 # Filters
|
fastapi-filters==0.2.9 # Filters
|
||||||
|
|||||||
Reference in New Issue
Block a user