-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Dockerfile.source
39 lines (34 loc) · 1.09 KB
/
Dockerfile.source
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
FROM node:lts-alpine3.14 AS build-web
ADD . /app
WORKDIR /app/web
# Build web
RUN yarn && yarn build
# Build jar
FROM gradle:6.1.1-jdk8 AS build-env
ADD --chown=gradle:gradle . /app
WORKDIR /app
COPY --from=build-web /app/web/dist /app/src/main/resources/web
RUN \
rm src/main/java/com/htmake/reader/ReaderUIApplication.kt; \
gradle -b cli.gradle assemble --info; \
mv ./build/libs/*.jar ./build/libs/reader.jar
FROM amazoncorretto:8u332-alpine3.14-jre
# Install base packages
RUN \
# apk update; \
# apk upgrade; \
# Add CA certs tini tzdata
apk add --no-cache ca-certificates tini tzdata; \
update-ca-certificates; \
# Clean APK cache
rm -rf /var/cache/apk/*;
# 时区
ENV TZ=Asia/Shanghai
#RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
# && echo Asia/Shanghai > /etc/timdezone \
# && dpkg-reconfigure -f noninteractive tzdata
EXPOSE 8080
ENTRYPOINT ["/sbin/tini", "--"]
# COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
COPY --from=build-env /app/build/libs/reader.jar /app/bin/reader.jar
CMD ["java", "-jar", "/app/bin/reader.jar" ]