-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
51 lines (40 loc) · 1.12 KB
/
Dockerfile.dev
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
41
42
43
44
45
46
47
48
49
50
##
# Build Stage
#
FROM maven:3.9.7-eclipse-temurin-21-jammy as build
RUN apt-get -y update
##
# Build Dependencies
#
WORKDIR /build/astm-http-lib
ADD ./astm-http-lib/pom.xml /build/astm-http-lib/pom.xml
RUN mvn dependency:go-offline
ADD ./astm-http-lib/src /build/astm-http-lib/src
RUN mvn clean install -DskipTests
##
# Build Project
#
WORKDIR /build
ADD ./pom.xml /build/pom.xml
RUN mvn dependency:go-offline
ADD ./src /build/src
RUN mvn clean package -DskipTests
##
# Run Stage
#
FROM eclipse-temurin:21-jre-alpine
RUN addgroup -S astm --gid 9257 && adduser -S astm -s /bin/bash -u 9257 -G astm
RUN mkdir /app
RUN chown astm:astm /app
#Deploy the war into tomcat image and point root to it
COPY --from=build /build/target/*.jar /app/astm-http-bridge.jar
ADD healthcheck.sh /app/healthcheck.sh
ADD docker-entrypoint.sh /app/docker-entrypoint.sh
RUN chown astm:astm /app/docker-entrypoint.sh; \
chmod 770 /app/docker-entrypoint.sh; \
chown astm:astm /app/ASTM.jar; \
chmod 770 /app/ASTM.jar; \
chown astm:astm /app/healthcheck.sh; \
chmod 770 /app/healthcheck.sh;
USER astm:astm
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]