forked from ivancorrales/festify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# syntax=docker/dockerfile:1.7
# Args que pasarás desde el workflow
ARG PROFILE=dev
ARG APP_VERSION=dev
# Runtime estable y multi-arch (Debian/Ubuntu), no Alpine
FROM --platform=$TARGETPLATFORM eclipse-temurin:17-jre-jammy AS runtime
# Metadatos útiles
LABEL org.opencontainers.image.title="Festify" \
org.opencontainers.image.version="${APP_VERSION}" \
org.opencontainers.image.description="Festify API" \
org.opencontainers.image.licenses="MIT"
# Directorio app y usuario no root
WORKDIR /app
RUN useradd -r -u 10001 appuser && chown -R appuser:appuser /app
USER appuser
# Copiamos el jar construido por Maven en CI
# (tu pipeline ya hace `mvn package` y deja el jar en target/)
COPY --chown=appuser:appuser target/*.jar /app/app.jar
# Variables de entorno típicas (Spring)
ENV SPRING_PROFILES_ACTIVE=${PROFILE} \
APP_VERSION=${APP_VERSION} \
JAVA_OPTS=""
EXPOSE 8080
# Healthcheck (si tienes actuator; si no, elimina esta línea)
HEALTHCHECK --interval=30s --timeout=3s --start-period=20s --retries=3 \
CMD sh -c 'wget -qO- http://127.0.0.1:8080/actuator/health || pgrep -f app.jar >/dev/null || exit 1'
ENTRYPOINT ["sh","-c","java $JAVA_OPTS -jar /app/app.jar"]