-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (25 loc) · 1 KB
/
Dockerfile
File metadata and controls
30 lines (25 loc) · 1 KB
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
FROM maven:3.8.6-amazoncorretto-17 AS build
# 设置工作目录
WORKDIR /usr/src/app
# 将本地的 Maven 设置文件和环境变量设置文件复制到容器中
COPY .mvn .mvn
COPY pom.xml .
COPY src src
RUN ls -l *
# 使用 Maven 构建应用
RUN mvn package -DskipTests
FROM eclipse/ubuntu_jdk8
WORKDIR /app
# 将构建的 jar 文件复制到新的容器中
COPY --from=build /usr/src/app/target/*.jar /app/app.jar
# web port
EXPOSE 8080
# Install Fonts because the SDK image contains very few fonts. The command copies font files from local to docker image. Make sure you have a local “fonts” directory that contains all the fonts you need to install. In this example, the local “fonts” directory is put in the same directory as the Dockerfile.
# COPY fonts/* /usr/share/fonts/
RUN mkdir -p /app/wb
RUN mkdir -p /app/grid_cache/streamcache
RUN mkdir -p /app/upload
COPY wb/*.xlsx /app/wb/
# RUN ls -l /app/
# 启动应用
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app/app.jar"]