Files
todo/backend/Dockerfile
almazlar d9e69e03ad
Some checks failed
Release and Build Docker Images / release-and-build (push) Has been cancelled
fix: update server port to 8080 in Dockerfile and application properties
2026-02-22 17:29:04 +03:00

25 lines
702 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Build stage ---------------------------------------------------------------
FROM maven:3.9.12-eclipse-temurin-25 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package
# Run stage ---------------------------------------------------------------
FROM eclipse-temurin:25-jre
WORKDIR /app
ARG APP_VERSION=dev
ENV APP_VERSION=${APP_VERSION}
# Install curl (required for the healthcheck)
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:8080/api/actuator/health || exit 1