material_manage_system/Dockerfile.deploy
copper-xw 9c78dcb6db feat: 支持前端 go:embed 单容器部署
新增部署专用 Dockerfile.deploy / docker-compose.deploy.yml 与本机构建脚本:
前端 dist 经 go:embed 编入 Go 二进制,alpine 运行时只打包不编译,
旧 Dockerfile 与双容器编排保持不变。
2026-10-10 16:14:49 +08:00

19 lines
573 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 部署镜像:只打包本机已编译好的二进制(含嵌入前端),镜像内不做任何编译。
# 构建前置:先执行 scripts/deploy-build.sh 产出 deploy/server。
FROM alpine:3.20
WORKDIR /app
# 运行时依赖:证书、时区;nc 由 busybox 自带(entrypoint 探活用)
RUN apk add --no-cache ca-certificates tzdata && mkdir -p /app/uploads
COPY deploy/server /app/server
COPY deploy/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
EXPOSE 8082
ENV GIN_MODE=release
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["/app/server"]