2023-04-09 14:53:26 +00:00
|
|
|
# 构建 beancount-gs
|
2024-07-04 09:32:16 +00:00
|
|
|
FROM golang:1.17.3-alpine 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
|
|
|
|
|
|
2023-04-09 14:53:26 +00:00
|
|
|
WORKDIR /build
|
|
|
|
|
COPY . .
|
2024-07-04 09:32:16 +00:00
|
|
|
COPY public/icons /build/public/default_icons
|
2022-07-26 14:28:40 +00:00
|
|
|
RUN go build .
|
|
|
|
|
|
2023-04-09 14:53:26 +00:00
|
|
|
# 镜像
|
2024-07-04 09:32:16 +00:00
|
|
|
FROM python:3.11.9-alpine3.19
|
2022-07-26 14:28:40 +00:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
2024-07-04 09:32:16 +00:00
|
|
|
|
|
|
|
|
RUN echo "https://mirrors.aliyun.com/alpine/v3.16/main/" > /etc/apk/repositories \
|
|
|
|
|
&& echo "https://mirrors.aliyun.com/alpine/v3.16/community/" >> /etc/apk/repositories \
|
|
|
|
|
&& set -x \
|
|
|
|
|
&& apk update \
|
|
|
|
|
&& apk add --no-cache gcc musl-dev \
|
|
|
|
|
&& python3 -mvenv /app/beancount \
|
|
|
|
|
&& /app/beancount/bin/pip install --no-cache-dir beanquery -i https://mirrors.aliyun.com/pypi/simple/ \
|
|
|
|
|
&& apk del gcc musl-dev
|
|
|
|
|
|
|
|
|
|
COPY --from=go_builder /build/beancount-gs /app
|
|
|
|
|
COPY --from=go_builder /build/template /app/template
|
|
|
|
|
COPY --from=go_builder /build/config /app/config
|
|
|
|
|
COPY --from=go_builder /build/public /app/public
|
|
|
|
|
COPY --from=go_builder /build/logs /app/logs
|
|
|
|
|
|
|
|
|
|
ENV LANG=C.UTF-8 \
|
|
|
|
|
SHELL=/bin/bash \
|
|
|
|
|
PS1="\u@\h:\w \$ " \
|
2024-07-04 09:47:09 +00:00
|
|
|
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app/bin:/app/beancount/bin"
|
2024-07-04 09:32:16 +00:00
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/bin/sh", "-c", "cp -rn /app/public/default_icons/* /app/public/icons && /app/beancount-gs -p 80" ]
|