beancount-gs/dockerfile

42 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

# 构建 beancount-gs
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
WORKDIR /build
COPY . .
COPY public/icons /build/public/default_icons
2022-07-26 14:28:40 +00:00
RUN go build .
# 镜像
FROM python:3.11.9-alpine3.19
2022-07-26 14:28:40 +00:00
WORKDIR /app
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"
EXPOSE 80
ENTRYPOINT [ "/bin/sh", "-c", "cp -rn /app/public/default_icons/* /app/public/icons && /app/beancount-gs -p 80" ]