Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
haust-lyb
html2pdf
Repository navigation
Code
Issues
2
(2)
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
html2pdf
/
Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
58 lines (38 loc) · 1.42 KB
master
Breadcrumbs
html2pdf
/
Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
58 lines (38 loc) · 1.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
51
52
53
54
55
56
57
58
# 使用 Maven 镜像作为基础镜像
FROM maven:3.5.4 AS build
# 设置工作目录
WORKDIR /app
# 如果你想要设置 Maven 镜像源,你可以将 Maven 的 settings.xml 文件拷贝到容器中
COPY settings.xml /root/.m2/settings.xml
COPY pom.xml pom.xml
RUN mvn compile
#RUN mvn dependency:go-offline
# 将 Maven 项目的 pom.xml 和其他依赖项拷贝到容器中
COPY . .
RUN ls -alh
# 下载 Maven 项目的依赖项,但不执行构建
RUN mvn clean
# 使用 Maven 构建 Spring Boot 项目
RUN mvn package -DskipTests
RUN ls -alh
RUN pwd
# 使用 AdoptOpenJDK 镜像作为运行时环境
FROM openjdk:8-jdk-alpine AS runtime
# 设置工作目录
WORKDIR /app
RUN apk update
# 解决openjdk镜像中缺少字体导致无法生成验证码的问题【https://blog.csdn.net/weixin_42389247/article/details/108083842】
RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
# 安装wkhtmltopdf
RUN apk add wkhtmltopdf
# 解决汉语无法显示的问题
RUN mkdir -p /usr/share/fonts/chinese/TrueType
# 从上次构建阶段中复制SIMSUN
COPY --from=build /app/SIMSUN.TTC /usr/share/fonts/chinese/TrueType/SIMSUN.TTC
RUN ls /usr/share/fonts/chinese/TrueType/
# 从构建阶段中复制构建好的 JAR 文件到运行时环境
COPY --from=build /app/target/*.jar app.jar
# 暴露 Spring Boot 应用程序的端口(如果需要)
EXPOSE 16666
# 定义容器启动命令
CMD ["java", "-jar", "app.jar"]
You can’t perform that action at this time.