Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
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 }}
thothawei
mes-workorder
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
mes-workorder
/
Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 1.39 KB
main
Breadcrumbs
mes-workorder
/
Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
35 lines (28 loc) · 1.39 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
# ---- 建置階段 ----
# 用 JDK 17 建置:Lombok 的 annotation processing 在較新的 JDK 上會靜默失效,
# 釘死版本可省下一輪莫名其妙的 cannot find symbol。
FROM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /build
# 先只複製 pom.xml 下載依賴,這一層在原始碼改動時可以重用快取,
# 每次改一行程式碼就重抓整個 Maven repository 是很浪費的。
COPY pom.xml .
RUN mvn -B dependency:go-offline
COPY src ./src
# 映像檔建置時跳過測試:測試需要 Docker(Testcontainers),
# 而 Docker in Docker 不是這裡該處理的問題。測試由 CI 或本機 mvn verify 負責。
RUN mvn -B clean package -DskipTests
# ---- 執行階段 ----
# JRE 而非 JDK,映像檔小一半。
#
# 用 jammy 而不是 alpine:Temurin 的 alpine 變體只發布 amd64,
# 在 Apple Silicon(arm64)上會失敗於「no match for platform in manifest」。
# 為了省那 100MB 而讓一半的開發者 build 不起來並不划算。
FROM eclipse-temurin:17-jre-jammy
WORKDIR /app
# 不以 root 執行(Debian/Ubuntu 基底用 groupadd/useradd,不是 alpine 的 addgroup/adduser)
RUN groupadd -r mes && useradd -r -g mes mes
USER mes
COPY --from=build /build/target/*.jar app.jar
EXPOSE 8080
# 容器環境下讓 JVM 依實際配額決定 heap,而不是看到整台主機的記憶體
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75", "-jar", "app.jar"]
You can’t perform that action at this time.