-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
50 lines (36 loc) · 1.44 KB
/
Dockerfile
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
FROM eclipse-temurin:17 as builder
RUN apt update && apt install wget -y
COPY . .
RUN curl -S https://raw.githubusercontent.com/sindresorhus/github-markdown-css/main/github-markdown-dark.css > ./src/main/resources/static/style.css
RUN wget https://upload.wikimedia.org/wikipedia/commons/7/74/Kotlin_Icon.png -O ./src/main/resources/static/favicon.png
RUN case "$(arch)" in \
amd64|x86_64) \
BINARY_URL='https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse'; \
;; \
aarch64) \
BINARY_URL='https://api.adoptium.net/v3/binary/latest/17/ga/linux/aarch64/jdk/hotspot/normal/eclipse'; \
;; \
esac; \
wget -O /tmp/openjdk.tar.gz -q ${BINARY_URL};
RUN ./gradlew --no-daemon installDist
FROM ubuntu:latest as custom-java
COPY --from=builder /tmp/openjdk.tar.gz /tmp/openjdk.tar.gz
RUN mkdir -p /opt/java/openjdk; \
tar --extract \
--file /tmp/openjdk.tar.gz \
--directory /opt/java/openjdk \
--strip-components 1 \
--no-same-owner \
; \
rm -rf /tmp/openjdk.tar.gz;
ENV JAVA_HOME=/opt/java/openjdk \
PATH="/opt/java/openjdk/bin:$PATH"
WORKDIR /usr/app
ENV PORT=8088
ENV DASHBOARD_PORT=8089
EXPOSE 8089
EXPOSE 8088
ENTRYPOINT ["/bin/bash"]
FROM custom-java
COPY --from=builder build/install/redirekt ./
ENTRYPOINT ["/usr/app/bin/redirekt"]