nextcloud-spreed-signaling/docker/proxy/Dockerfile
Joachim Bauch 838e601183
docker: Create "/.dockerenv" if it doesn't exist.
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.
2023-11-15 12:03:43 +01:00

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"]