-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile2
40 lines (26 loc) · 950 Bytes
/
Dockerfile2
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
37
38
39
40
FROM maven:3.9.6-eclipse-temurin-21-alpine AS build
LABEL authors="hendisantika"
RUN mkdir /project
COPY . /project
# Passed from Github Actions
ARG GIT_VERSION_TAG=unspecified
ARG GIT_COMMIT_MESSAGE=unspecified
ARG GIT_VERSION_HASH=unspecified
WORKDIR /project
# You can read these files for the information in your application
RUN echo $GIT_VERSION_TAG > GIT_VERSION_TAG.txt
RUN echo $GIT_COMMIT_MESSAGE > GIT_COMMIT_MESSAGE.txt
RUN echo $GIT_VERSION_HASH > GIT_VERSION_HASH.txt
RUN mvn clean package
#FROM adoptopenjdk/openjdk21:eclipse-temurin-21-alpine
#FROM bellsoft/liberica-openjdk-debian:21
#FROM openjdk:21-slim
FROM amazoncorretto:21-alpine-jdk
LABEL maintainer="hendisantika@yahoo.co.id"
RUN mkdir /app
RUN addgroup -g 1001 -S hendigroup
RUN adduser -S hendi -u 1001
COPY --from=build /project/target/HikariCP-0.0.1.jar /app/HikariCP.jar
WORKDIR /app
RUN chown -R hendi:hendigroup /app
CMD java $JAVA_OPTS -jar HikariCP.jar