You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
gpt/Dockerfile

45 lines
713 B

# Build
FROM golang:alpine AS build
RUN apk add --no-cache -U build-base
RUN mkdir -p /src
WORKDIR /src
# Copy go.mod and go.sum and install and cache dependencies
COPY go.mod .
COPY go.sum .
# Install deps
RUN go mod download
# Copy sources
COPY *.go ./
# Build server binary
RUN go build
# Runtime
FROM alpine:latest
RUN apk --no-cache -U add su-exec shadow ca-certificates
ENV PUID=1000
ENV PGID=1000
RUN addgroup -g "${PGID}" gpt && \
adduser -D -H -G gpt -h /var/empty -u "${PUID}" gpt && \
mkdir -p /data && chown -R gpt:gpt /data
VOLUME /data
WORKDIR /
COPY --from=build /src/gpt /usr/local/bin/gpt
COPY .dockerfiles/entrypoint.sh /init
ENTRYPOINT ["/init"]
CMD ["gpt", "-server"]