Files
cameleer-server/Dockerfile
hsiegeln 1ed2d3a611 chore(docker): full-stack docker-compose mirroring deploy/ k8s manifests
Mirrors the k8s manifests in deploy/ as a local dev stack:
  - cameleer-postgres   (matches deploy/cameleer-postgres.yaml)
  - cameleer-clickhouse (matches deploy/cameleer-clickhouse.yaml, default CLICKHOUSE_DB=cameleer)
  - cameleer-server     (built from Dockerfile, env mirrors deploy/base/server.yaml)
  - cameleer-ui         (built from ui/Dockerfile, served on host :8080 to leave :5173 free for Vite dev)

Dockerfile + ui/Dockerfile: REGISTRY_TOKEN is now optional (empty → skip Maven/npm auth).
cameleer-common package is public, so anonymous pulls succeed; private packages still require the token.

Backend defaults tuned for local E2E:
  - RUNTIME_ENABLED=false (no Docker-in-Docker deployments in dev stack)
  - OUTBOUND_HTTP_ALLOW_PRIVATE_TARGETS=true (so webhook tests can target host.docker.internal etc.)
  - UIUSER/UIPASSWORD=admin/admin (matches Playwright E2E_ADMIN_USER/PASS defaults)
  - CORS includes both :5173 (Vite) and :8080 (nginx)
2026-04-20 15:52:24 +02:00

30 lines
1.1 KiB
Docker

FROM --platform=$BUILDPLATFORM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /build
# Optional auth for Gitea Maven Registry. The `cameleer/cameleer-common` package
# is published publicly, so empty token → anonymous pull (no settings.xml).
# Private packages require a non-empty token.
ARG REGISTRY_TOKEN=""
RUN if [ -n "$REGISTRY_TOKEN" ]; then \
mkdir -p ~/.m2 && \
printf '<settings><servers><server><id>gitea</id><username>cameleer</username><password>%s</password></server></servers></settings>\n' "$REGISTRY_TOKEN" > ~/.m2/settings.xml; \
fi
COPY pom.xml .
COPY cameleer-server-core/pom.xml cameleer-server-core/
COPY cameleer-server-app/pom.xml cameleer-server-app/
# Cache deps — only re-downloaded when POMs change
RUN mvn dependency:go-offline -B || true
COPY . .
RUN mvn clean package -DskipTests -U -B
FROM eclipse-temurin:17-jre
WORKDIR /app
COPY --from=build /build/cameleer-server-app/target/cameleer-server-app-*.jar /app/server.jar
COPY docker-entrypoint.sh /app/
RUN chmod +x /app/docker-entrypoint.sh
EXPOSE 8081
ENV TZ=UTC
ENTRYPOINT ["/app/docker-entrypoint.sh"]