-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 808 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 808 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
# Single stage build using Maven image
FROM maven:3.9.8-eclipse-temurin-17
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline
COPY src ./src
RUN mvn clean package -DskipTests
# # Create a user and group to run the application
# RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
# # Change ownership of the app directory
# RUN chown -R appuser:appgroup /app
# # Switch to the non-root user
# USER appuser
# Command to run the application
ENTRYPOINT ["java", "-jar", "/app/target/feature-flags-proxy-1.0-SNAPSHOT.jar"]
# Expose the port the application runs on
EXPOSE 8080
# Health check to ensure the container is running properly
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1