mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-09 17:16:34 +02:00
838e601183
When building through the CI builders, detection of the Docker environment doesn't work. So we always create the file manually to make sure the version contains "~docker" in this case.
29 lines
873 B
Docker
29 lines
873 B
Docker
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine AS builder
|
|
ARG TARGETARCH
|
|
ARG TARGETOS
|
|
|
|
WORKDIR /workdir
|
|
|
|
COPY . .
|
|
RUN touch /.dockerenv && \
|
|
apk add --no-cache bash git build-base protobuf && \
|
|
if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make proxy; else \
|
|
GOOS=${TARGETOS} GOARCH=${TARGETARCH} make proxy; fi
|
|
|
|
FROM alpine:3
|
|
|
|
ENV CONFIG=/config/proxy.conf
|
|
RUN adduser -D spreedbackend && \
|
|
apk add --no-cache bash tzdata ca-certificates
|
|
|
|
COPY --from=builder /workdir/bin/proxy /usr/bin/nextcloud-spreed-signaling-proxy
|
|
COPY ./proxy.conf.in /config/proxy.conf.in
|
|
COPY ./docker/proxy/entrypoint.sh /
|
|
RUN chown spreedbackend /config
|
|
RUN /usr/bin/nextcloud-spreed-signaling-proxy -version
|
|
|
|
USER spreedbackend
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
CMD ["/bin/sh", "-c", "/usr/bin/nextcloud-spreed-signaling-proxy -config $CONFIG"]
|