2020-10-29 00:00:58 +08:00
|
|
|
FROM golang:alpine AS binarybuilder
|
|
|
|
RUN apk --no-cache --no-progress add \
|
2020-10-29 11:20:32 +08:00
|
|
|
gcc git musl-dev
|
2020-10-29 00:00:58 +08:00
|
|
|
WORKDIR /dashboard
|
|
|
|
COPY . .
|
2021-01-16 00:45:49 +08:00
|
|
|
RUN cd cmd/dashboard && go build -o app -ldflags="-s -w"
|
2020-10-29 00:14:31 +08:00
|
|
|
|
2020-10-29 00:00:58 +08:00
|
|
|
FROM alpine:latest
|
2021-01-19 09:59:04 +08:00
|
|
|
ENV TZ="Asia/Shanghai"
|
2022-05-17 20:54:01 +08:00
|
|
|
COPY ./script/entrypoint.sh /entrypoint.sh
|
2020-10-29 00:00:58 +08:00
|
|
|
RUN apk --no-cache --no-progress add \
|
|
|
|
ca-certificates \
|
2021-01-19 09:59:04 +08:00
|
|
|
tzdata && \
|
|
|
|
cp "/usr/share/zoneinfo/$TZ" /etc/localtime && \
|
2022-05-17 19:52:02 +08:00
|
|
|
echo "$TZ" > /etc/timezone && \
|
|
|
|
chmod +x /entrypoint.sh
|
2020-10-29 00:00:58 +08:00
|
|
|
WORKDIR /dashboard
|
2020-10-29 00:14:31 +08:00
|
|
|
COPY ./resource ./resource
|
2020-10-29 00:00:58 +08:00
|
|
|
COPY --from=binarybuilder /dashboard/cmd/dashboard/app ./app
|
|
|
|
|
|
|
|
VOLUME ["/dashboard/data"]
|
2020-11-06 21:00:42 +08:00
|
|
|
EXPOSE 80 5555
|
2022-05-17 19:52:02 +08:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|