1
0
forked from EHV/sejeteralo
Files
sejeteralo/docker/frontend.Dockerfile
syoul 45253ba705 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>
2026-03-13 18:15:12 +01:00

40 lines
739 B
Docker

# syntax = docker/dockerfile:1
ARG NODE_VERSION=20-slim
FROM node:${NODE_VERSION} AS base
WORKDIR /src
# Build
FROM base AS build
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# Production
FROM base AS production
ENV PORT=3000
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /src/.output /src/.output
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:${PORT}/ || exit 1
EXPOSE $PORT
CMD [ "node", ".output/server/index.mjs" ]
# Development
FROM base AS development
WORKDIR /app
ENTRYPOINT [ "npm", "run", "dev" ]