2020-08-12 06:51:30 +08:00
|
|
|
# build stage
|
2022-08-11 20:22:10 +08:00
|
|
|
FROM ghcr.io/ghcri/golang:1.19-alpine3.16 AS builder
|
2020-08-12 06:51:30 +08:00
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2022-02-13 23:38:54 +08:00
|
|
|
RUN go build -ldflags '-s -w'
|
2020-08-12 06:51:30 +08:00
|
|
|
|
|
|
|
# server image
|
2022-02-13 23:38:54 +08:00
|
|
|
|
2022-08-11 20:22:10 +08:00
|
|
|
FROM ghcr.io/ghcri/alpine:3.16
|
2022-02-13 23:38:54 +08:00
|
|
|
LABEL org.opencontainers.image.source https://github.com/go-shiori/shiori
|
|
|
|
COPY --from=builder /src/shiori /usr/bin/
|
|
|
|
RUN addgroup -g 1000 shiori \
|
2022-08-11 20:22:10 +08:00
|
|
|
&& adduser -D -h /shiori -g '' -G shiori -u 1000 shiori
|
2022-02-13 23:38:54 +08:00
|
|
|
USER shiori
|
|
|
|
WORKDIR /shiori
|
2019-09-21 18:09:03 +08:00
|
|
|
EXPOSE 8080
|
2022-02-13 23:38:54 +08:00
|
|
|
ENV SHIORI_DIR /shiori/
|
|
|
|
ENTRYPOINT ["/usr/bin/shiori"]
|
2023-07-20 00:25:41 +08:00
|
|
|
CMD ["server"]
|