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
Small and medium teams
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 }}
LanshanTeam
lanmei-dream
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
lanmei-dream
/
Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
46 lines (32 loc) · 1.75 KB
main
Breadcrumbs
lanmei-dream
/
Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
46 lines (32 loc) · 1.75 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
# 多阶段构建:builder 编译静态二进制,运行阶段只携带二进制与运行时资源。
FROM golang:1.26-alpine AS builder
# 国内网络加速:Alpine 包源替换为腾讯云镜像(默认 dl-cdn.alpinelinux.org 境外访问慢)
RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.cloud.tencent.com#g' /etc/apk/repositories \
&& apk add --no-cache git
WORKDIR /app
# 国内网络加速:替换默认的 proxy.golang.org(境外访问超时)
ENV GOPROXY=https://goproxy.cn,direct
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# CGO_ENABLED=0 产出静态链接二进制(无 glibc 依赖),运行阶段用 alpine 即可;
# -s -w 去掉符号表与调试信息,减小镜像体积。
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /lanmei ./cmd/lanmei
# 运行阶段:alpine 基础镜像,仅补证书与时区。
FROM alpine:3.21
# 国内网络加速:Alpine 包源替换为腾讯云镜像。
# ca-certificates 供 HTTPS 出站调用(LLM、飞书等),tzdata 让 ENV TZ 生效。
RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.cloud.tencent.com#g' /etc/apk/repositories \
&& apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /lanmei /app/lanmei
# 运行时资源:config / prompts / skills / quizdata 默认打包进镜像。
# 目录内均为非敏感配置(密钥走环境变量),作为裸镜像自包含兜底;
# 使用 docker-compose 部署时会被只读挂载(./config:ro 等)覆盖。
COPY --from=builder /app/config /app/config
COPY --from=builder /app/prompts /app/prompts
COPY --from=builder /app/skills /app/skills
COPY --from=builder /app/quizdata /app/quizdata
# 环境变量通过 docker-compose / .env 注入,不硬编码
ENV TZ=Asia/Shanghai
ENTRYPOINT ["/app/lanmei"]
You can’t perform that action at this time.