-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (18 loc) · 760 Bytes
/
Dockerfile
File metadata and controls
27 lines (18 loc) · 760 Bytes
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
FROM eclipse-temurin:21-jre-alpine
# Add non-root user for security
RUN addgroup -S gateway && adduser -S gateway -G gateway
# Install curl for health checks and timezone data
RUN apk add --no-cache curl tzdata
WORKDIR /app
# Create logs directory
RUN mkdir -p /app/logs && chown -R gateway:gateway /app
# Copy the pre-built JAR (built locally)
COPY target/gateway-service-*.jar app.jar
# Change ownership to non-root user
RUN chown -R gateway:gateway /app
USER gateway
# Expose ports
EXPOSE 8080 8443
# JVM optimizations for containers and JDK 21
ENV JAVA_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.security.egd=file:/dev/./urandom"
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]