-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (18 loc) · 838 Bytes
/
Dockerfile
File metadata and controls
31 lines (18 loc) · 838 Bytes
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
# syntax=docker/dockerfile:1
# ========== 构建阶段 ==========
FROM harbor.atdak.com/library/maven:3.9-eclipse-temurin-21-alpine AS builder
WORKDIR /workspace
COPY . .
# --mount=type=cache 将 .m2 持久化在宿主机 BuildKit 缓存中,跨次构建复用,无需额外配置
RUN --mount=type=cache,target=/root/.m2 \
mvn -pl mortise-app -am clean package -DskipTests -B --no-transfer-progress
FROM harbor.atdak.com/library/eclipse-temurin:21-jre-alpine
LABEL maintainer="rymcu.com"
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache tzdata
WORKDIR /app
RUN mkdir -p /logs/mortise/data
COPY --from=builder /workspace/mortise-app/target/mortise.jar /app/mortise.jar
EXPOSE 9999
ENTRYPOINT ["java", "-jar", "/app/mortise.jar"]