38 lines
588 B
Docker
38 lines
588 B
Docker
FROM caddy:2.6-builder-alpine AS builder
|
|
|
|
WORKDIR /src
|
|
|
|
# Copy go.mod and go.sum and install and cache dependencies
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
|
|
# Copy sources
|
|
COPY *.go ./
|
|
COPY ./gitea/*.go ./gitea/
|
|
|
|
RUN go build .
|
|
|
|
# Runtime
|
|
FROM alpine:latest
|
|
|
|
RUN apk --no-cache -U add su-exec shadow tzdata ca-certificates
|
|
|
|
ENV PUID=1000
|
|
ENV PGID=1000
|
|
|
|
RUN mkdir -p /data && chown -R nobody:nobody /data
|
|
|
|
EXPOSE 8000/tcp
|
|
|
|
VOLUME /data
|
|
|
|
WORKDIR /data
|
|
|
|
COPY --from=builder /src/pages-server /usr/local/bin/pages-server
|
|
|
|
COPY .dockerfiles/entrypoint.sh /init
|
|
|
|
ENTRYPOINT ["/init"]
|
|
|
|
CMD ["pages-server"]
|