Improved Application/DB
Some checks failed
Build and Deploy Demo App / test (push) Failing after 1m14s
Build and Deploy Demo App / build (push) Has been skipped
Build and Deploy Demo App / scan (push) Has been skipped
Build and Deploy Demo App / deploy (push) Has been skipped

This commit is contained in:
2025-11-26 11:03:01 +03:30
parent c442b16a45
commit fcd328ca2b
9 changed files with 194 additions and 99 deletions

View File

@@ -1,9 +1,19 @@
FROM python:3.12-slim
# Build stage
FROM python:3.12-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
# Runtime stage
FROM python:3.12-slim
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY app.py models.py .
COPY templates ./templates
RUN useradd -m appuser
USER appuser
EXPOSE 5000
CMD ["python", "app.py"]
HEALTHCHECK --interval=30s --timeout=3s CMD wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]