beancount-gs/dockerfile

38 lines
1019 B
Plaintext
Raw Normal View History

# 构建 beancount
2023-04-09 18:14:01 +00:00
FROM python:3.7.16 as beancount_builder
WORKDIR /build
ENV PATH "/app/bin:$PATH"
RUN python3 -mvenv /app
2023-04-09 15:46:16 +00:00
RUN wget https://github.com/beancount/beancount/archive/refs/tags/2.3.5.tar.gz
RUN tar -zxvf 2.3.5.tar.gz
2023-04-09 18:00:03 +00:00
RUN python3 -m pip install ./beancount-2.3.5 -i https://mirrors.aliyun.com/pypi/simple/
RUN find /app -name __pycache__ -exec rm -rf -v {} +
# 构建 beancount-gs
2023-04-09 15:46:16 +00:00
FROM golang:1.17.3 AS go_builder
2022-07-26 14:28:40 +00:00
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct \
GIN_MODE=release \
CGO_ENABLED=0 \
PORT=80
WORKDIR /build
COPY . .
COPY public/icons ./public/default_icons
2022-07-26 14:28:40 +00:00
RUN go build .
# 镜像
2023-04-09 18:14:01 +00:00
FROM python:3.7.16-alpine
2022-07-26 14:28:40 +00:00
COPY --from=beancount_builder /app /app
2022-07-26 14:28:40 +00:00
WORKDIR /app
COPY --from=go_builder /build/beancount-gs ./
COPY --from=go_builder /build/template ./template
COPY --from=go_builder /build/config ./config
COPY --from=go_builder /build/public ./public
COPY --from=go_builder /build/logs ./logs
2022-07-26 14:28:40 +00:00
ENV PATH "/app/bin:$PATH"
EXPOSE 80