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
Events
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 }}
code-gopher
gostPanel
Repository navigation
Code
Issues
1
(1)
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
gostPanel
/
Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
52 lines (40 loc) · 1.35 KB
master
Breadcrumbs
gostPanel
/
Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
52 lines (40 loc) · 1.35 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
# 前端构建阶段
FROM node:20-alpine AS web-builder
WORKDIR /app/web
COPY web/package*.json ./
RUN npm ci
COPY web/ .
RUN npm run build
# 后端构建阶段
FROM golang:1.23-alpine AS backend-builder
WORKDIR /app
# 版本号参数(通过 --build-arg VERSION=xxx 传入)
ARG VERSION=dev
# 复制依赖文件
COPY go.mod go.sum ./
RUN go mod download
# 复制后端源码
COPY cmd/ cmd/
COPY internal/ internal/
COPY pkg/ pkg/
COPY config/ config/
# 从前端构建阶段复制 dist 到后端 embedding 路径
# 注意:前端构建输出到了 ../internal/router/dist,即 /app/internal/router/dist
COPY --from=web-builder /app/internal/router/dist ./internal/router/dist
# 编译(关闭 CGO,使用纯 Go SQLite 驱动,注入版本号)
RUN CGO_ENABLED=0 GOOS=linux \
go build -ldflags="-s -w -X 'gost-panel/internal/config.Version=${VERSION}'" -o gost-panel cmd/server/main.go
# 运行阶段
FROM alpine:latest
WORKDIR /app
RUN apk --no-cache add ca-certificates tzdata
ENV TZ=Asia/Shanghai
# 复制程序和配置
COPY --from=backend-builder /app/gost-panel .
COPY --from=backend-builder /app/config ./config
# 创建目录
RUN mkdir -p /app/data /app/logs
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/v1/health || exit 1
CMD ["./gost-panel"]
You can’t perform that action at this time.