config file error

This commit is contained in:
2024-11-01 00:29:35 +08:00
parent dcac6578dc
commit 431ab13673
4 changed files with 9 additions and 5 deletions

View File

@@ -14,15 +14,19 @@ COPY . .
# 构建可执行文件
RUN CGO_ENABLED=0 GOOS=linux go build -v -o app .
# 使用一个更小的基础镜像来减小最终镜像的大小
FROM alpine:latest
# 时区设置成当前时区
RUN apk add --no-cache tzdata
ENV TZ="Asia/Shanghai"
# 设置工作目录
WORKDIR /root/
# 从构建阶段复制可执行文件
COPY --from=builder /app/app .
# 在容器目录 /root/ 创建一个目录 为config
RUN mkdir conf .
COPY --from=builder /app/conf/ ./conf/
# 暴露端口
EXPOSE 8080