feat: déploiement Docker/Coolify — Dockerfile + docker-compose.yml + scalper serve (SCAL-15)
- serveur HTTP stdlib: GET /healthz, GET /check-source, POST /run (gate légal appliqué, 403 si bloqué) - image python:3.12-slim, user non-root, healthcheck, volumes data/out persistants - .env.example (.env ignoré), .dockerignore, docs/deploy-coolify.md - 39 tests OK + smoke loopback
This commit is contained in:
1 parent
876faf3ede
commit
67b165e913
9 files changed
+293
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml README.md ./
|
||||
COPY src ./src
|
||||
|
||||
RUN pip install --no-cache-dir .
|
||||
|
||||
RUN useradd -m scalper && mkdir -p /app/data /app/out && chown -R scalper:scalper /app
|
||||
USER scalper
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
EXPOSE 8000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz')" || exit 1
|
||||
|
||||
CMD ["scalper", "serve", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in new issue
Block a user