initial - add implementation for simple crowdsec app to list and delete non-CAPI decisions

This commit is contained in:
Viktor Barzin 2025-10-14 19:21:36 +00:00
commit 9aaf3d32d0
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
7 changed files with 349 additions and 0 deletions

34
Dockerfile Normal file
View file

@ -0,0 +1,34 @@
# ---- Stage 1: Build dependencies ----
FROM python:3.12-slim AS builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
# Copy requirement files
COPY requirements.txt .
# Install to a local folder
RUN pip install --prefix=/install -r requirements.txt
# ---- Stage 2: Runtime ----
FROM python:3.12-slim
WORKDIR /app
# Copy installed packages
COPY --from=builder /install /usr/local
# Copy app source
COPY . .
# Create non-root user
RUN useradd -m fastapiuser && chown -R fastapiuser /app
USER fastapiuser
# Expose FastAPI port
EXPOSE 8000
# Start app with uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]