Add deployment pipeline, Dockerfile, Nomad spec and tests
Some checks failed
Build and Deploy PunktFri / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy PunktFri / build-and-deploy (push) Has been cancelled
- Dockerfile: python:3.12-slim + gunicorn, dynamic port, BUILD_VERSION args - punktfri.nomad: Traefik routing for punktfri.i80.dk, host volume for SQLite - .gitea/workflows/deploy.yml: build/push to Harbor, deploy to Nomad - Makefile: install/run/test/build targets - tests/test_app.py: 9 pytest tests covering all routes and validation - requirements.txt: add gunicorn - requirements-dev.txt: pytest - app.py: health endpoint returns version/commit info
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
ARG BUILD_VERSION=dev
|
||||
ARG GIT_COMMIT=unknown
|
||||
ARG BUILD_TIME=unknown
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
FLASK_APP=app.py \
|
||||
BUILD_VERSION=${BUILD_VERSION} \
|
||||
GIT_COMMIT=${GIT_COMMIT} \
|
||||
BUILD_TIME=${BUILD_TIME} \
|
||||
PORT=5000 \
|
||||
HOST=0.0.0.0 \
|
||||
DATABASE=/app/instance/punktfri.db \
|
||||
LOG_FILE=/app/instance/signups.log
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p /app/instance
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["sh", "-c", "gunicorn --bind ${HOST}:${PORT} --workers 2 --timeout 60 app:app"]
|
||||
Reference in New Issue
Block a user