1
0
forked from EHV/sejeteralo

Migrate CI to single-step DinD with Fabio/Consul

Replace 5-step pipeline (build/test/push/push/deploy) with single
docker:dind step that builds and deploys in-place via Docker socket.

- .woodpecker.yml: single-step DinD, 1 secret (SECRET_KEY)
- docker-compose.fabio.yml: overlay with SERVICE_* labels for Registrator
- docker-compose.yml: add ports without host bind (Fabio/Traefik routing)
- docker-compose.dev.yml: named volumes with bind driver
- Dockerfiles: install curl, HEALTHCHECK via curl /api/health
- Makefile: docker-fabio, consul-services, fabio-routes targets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
syoul
2026-03-13 18:15:12 +01:00
parent ff901064e9
commit 45253ba705
7 changed files with 71 additions and 62 deletions

View File

@@ -17,13 +17,16 @@ FROM base AS production
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=build /usr/local/bin/uvicorn /usr/local/bin/uvicorn
COPY --from=build /usr/local/bin/alembic /usr/local/bin/alembic
COPY --from=build /app /app
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/docs')" || exit 1
CMD curl -f http://localhost:8000/api/health || exit 1
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]