diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee2e220 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM eclipse-temurin:17-jdk-focal + +WORKDIR /app + +COPY .mvn/ .mvn +COPY mvnw pom.xml ./ +RUN chmod +x mvnw +RUN ./mvnw dependency:go-offline + +COPY src ./src + +CMD ["./mvnw", "spring-boot:run"] diff --git a/compose.yaml b/compose.yaml index 0baad47..f6805ac 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1 +1,31 @@ +version: '3.8' + services: + app: + build: + context: . + dockerfile: Dockerfile + ports: + - "8080:8080" + volumes: + - .:/app + - maven_cache:/root/.m2 + environment: + SPRING_PROFILES_ACTIVE: dev + JAVA_OPTS: "-Xmx512m -Xms256m" + networks: + - app-network + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/health/health" ] + interval: 1m30s + timeout: 10s + retries: 3 + start_period: 40s + +networks: + app-network: + driver: bridge + +volumes: + maven_cache: + driver: local \ No newline at end of file