parcoursmob/Dockerfile

34 lines
950 B
Docker
Raw Permalink Normal View History

2022-11-01 22:47:49 +00:00
FROM golang:alpine as builder
ARG ACCESS_TOKEN_USR="nothing"
ARG ACCESS_TOKEN_PWD="nothing"
RUN apk add --no-cache ca-certificates tzdata git
WORKDIR /
# Create a netrc file using the credentials specified using --build-arg
RUN printf "machine git.coopgo.io\n\
login ${ACCESS_TOKEN_USR}\n\
2022-11-06 17:44:29 +00:00
password ${ACCESS_TOKEN_PWD}\n\
\n"\
2022-11-01 22:47:49 +00:00
>> ~/.netrc
RUN chmod 600 ~/.netrc
COPY . .
RUN go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server
RUN rm -r themes/*
2022-11-07 00:24:16 +00:00
RUN git clone --depth 1 https://git.coopgo.io/coopgo-apps/parcoursmob-default-theme themes/default
RUN git clone -b spie06 --depth 1 https://git.coopgo.io/coopgo-apps/parcoursmob-default-theme themes/spie06
2022-11-01 22:47:49 +00:00
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
2022-11-06 17:44:29 +00:00
COPY --from=builder /themes/ /themes/
2022-11-01 22:47:49 +00:00
COPY --from=builder /server /
EXPOSE 8080
ENTRYPOINT ["/server"]