config file error
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user