Files
soul-yongping/soul-api/deploy/Dockerfile.local
Alex-larget 6df1736e1e 1
2026-03-20 14:47:37 +08:00

27 lines
791 B
Docker
Raw 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.

# Dockerfile.local - 使用本地 Go 编译后的二进制,无需拉取 golang 镜像
# 使用方式deploy.py --mode docker --local-go
# 依赖:先由本地 go build 生成 soul-api 可执行文件
# 使用标准引用,配合 --pull=false 使用本地缓存的 alpine:3.19
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata wget
ENV TZ=Asia/Shanghai
RUN adduser -D -g '' appuser
WORKDIR /app
COPY soul-api .
# 微信支付等证书(须存在于构建上下文,勿在 .dockerignore 中排除)
COPY certs/ /app/certs/
# 由 devloy 传入 --build-arg ENV_FILE=(如 .env / .env.development
ARG ENV_FILE=.env.production
COPY ${ENV_FILE} /app/.env
RUN mkdir -p /app/uploads && chown -R appuser:appuser /app
USER appuser
EXPOSE 8080
ENTRYPOINT ["./soul-api"]