2023-04-09 14:53:26 +00:00
|
|
|
# 构建 beancount-gs
|
2024-07-08 06:32:58 +00:00
|
|
|
FROM golang:1.17.3 AS go_builder
|
2022-07-26 14:28:40 +00:00
|
|
|
|
|
|
|
|
ENV GO111MODULE=on \
|
2024-07-08 06:32:58 +00:00
|
|
|
GOPROXY=https://goproxy.cn,direct \
|
|
|
|
|
GIN_MODE=release \
|
|
|
|
|
CGO_ENABLED=0 \
|
|
|
|
|
PORT=80
|
2022-07-26 14:28:40 +00:00
|
|
|
|
2024-07-08 06:32:58 +00:00
|
|
|
WORKDIR /app
|
2023-04-09 14:53:26 +00:00
|
|
|
COPY . .
|
2024-07-08 06:32:58 +00:00
|
|
|
COPY public/icons ./public/default_icons
|
2022-07-26 14:28:40 +00:00
|
|
|
RUN go build .
|
|
|
|
|
|
2023-04-09 14:53:26 +00:00
|
|
|
# 镜像
|
2024-07-08 16:15:01 +00:00
|
|
|
FROM xdbin/beancount-alpine:2.3.6
|
2022-07-26 14:28:40 +00:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
2024-07-08 06:32:58 +00:00
|
|
|
COPY --from=go_builder /app/beancount-gs ./
|
|
|
|
|
COPY --from=go_builder /app/template ./template
|
|
|
|
|
COPY --from=go_builder /app/config ./config
|
|
|
|
|
COPY --from=go_builder /app/public ./public
|
|
|
|
|
COPY --from=go_builder /app/logs ./logs
|
2024-07-04 09:32:16 +00:00
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
2024-07-08 06:32:58 +00:00
|
|
|
ENTRYPOINT [ "/bin/sh", "-c", "cp -rn /app/public/default_icons/* /app/public/icons && /app/beancount-gs -p 80" ]
|