diff --git a/.lionsctl.yaml b/.lionsctl.yaml new file mode 100644 index 0000000..f185142 --- /dev/null +++ b/.lionsctl.yaml @@ -0,0 +1,24 @@ +# Configuration lionsctl pour unionflow-client +deployment: + replicas: 1 + domain: unionflow.lions.dev + port: 8086 + environment: production + +resources: + limits: + cpu: "1" + memory: "1Gi" + requests: + cpu: "200m" + memory: "512Mi" + +health: + liveness: + initialDelaySeconds: 120 + periodSeconds: 10 + port: 8086 + readiness: + initialDelaySeconds: 60 + periodSeconds: 5 + port: 8086 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5f4d541 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,59 @@ +#### +# Dockerfile pour UnionFlow Client - Compatible lionsctl +# Utilise l'uber-jar pré-compilé par Maven +#### + +FROM eclipse-temurin:17-jre-alpine + +ENV LANGUAGE='en_US:en' + +# Configuration Quarkus +ENV QUARKUS_PROFILE=prod +ENV QUARKUS_HTTP_PORT=8086 +ENV QUARKUS_HTTP_HOST=0.0.0.0 + +# Configuration Backend UnionFlow +ENV UNIONFLOW_BACKEND_URL=https://lions.dev/unionflow + +# Configuration Keycloak OIDC +ENV KEYCLOAK_AUTH_SERVER_URL=https://security.lions.dev/realms/unionflow +ENV KEYCLOAK_CLIENT_SECRET=unionflow-client-secret-2025 + +# Créer l'utilisateur appuser +RUN addgroup -g 185 appuser && adduser -D -u 185 -G appuser appuser + +# Installer curl pour health checks +RUN apk add --no-cache curl + +# Créer les répertoires nécessaires +RUN mkdir -p /app/logs /app/storage && chown -R appuser:appuser /app + +WORKDIR /app + +# Copier l'uber-jar depuis target/ +COPY --chown=appuser:appuser target/*-runner.jar /app/app.jar + +USER appuser + +# Exposer le port 8086 +EXPOSE 8086 + +# Variables JVM optimisées +ENV JAVA_OPTS="-Xmx1g -Xms512m \ + -XX:+UseG1GC \ + -XX:MaxGCPauseMillis=200 \ + -XX:+UseStringDeduplication \ + -XX:+HeapDumpOnOutOfMemoryError \ + -XX:HeapDumpPath=/app/logs/heapdump.hprof \ + -Djava.security.egd=file:/dev/./urandom \ + -Djava.awt.headless=true \ + -Dfile.encoding=UTF-8 \ + -Djava.util.logging.manager=org.jboss.logmanager.LogManager \ + -Dquarkus.profile=${QUARKUS_PROFILE}" + +# Point d'entrée +ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -jar /app/app.jar"] + +# Health check sur le bon port +HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \ + CMD curl -f http://localhost:8086/q/health/ready || exit 1