2023-02-02 13:27:27 +01:00
|
|
|
FROM --platform=${BUILDPLATFORM} golang:1.20 AS builder
|
2022-08-05 15:01:19 +02:00
|
|
|
|
|
|
|
WORKDIR /workdir
|
|
|
|
|
2022-12-23 22:51:51 +01:00
|
|
|
ARG TARGETARCH
|
|
|
|
ARG TARGETOS
|
|
|
|
|
2022-08-05 15:01:19 +02:00
|
|
|
COPY . .
|
|
|
|
RUN apt-get -y update && \
|
|
|
|
apt-get -y install protobuf-compiler && \
|
2022-12-23 22:51:51 +01:00
|
|
|
if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make server -j$(nproc); else \
|
|
|
|
GOOS=${TARGETOS} GOARCH=${TARGETARCH} make server -j$(nproc); fi
|
2022-08-05 15:01:19 +02:00
|
|
|
|
2023-02-22 11:44:10 +01:00
|
|
|
FROM debian:bullseye-slim
|
2022-08-05 15:01:19 +02:00
|
|
|
|
|
|
|
ENV CONFIG=/config/server.conf
|
2023-02-22 11:44:10 +01:00
|
|
|
RUN adduser --system --no-create-home spreedbackend && \
|
|
|
|
apt-get update -y && \
|
|
|
|
apt-get install -y ca-certificates && \
|
|
|
|
rm -rf /var/apt/lists/*
|
2022-08-05 15:01:19 +02:00
|
|
|
|
|
|
|
COPY --from=builder /workdir/bin/signaling /usr/bin/nextcloud-spreed-signaling
|
|
|
|
COPY ./server.conf.in /config/server.conf.in
|
|
|
|
COPY ./docker/server/entrypoint.sh /
|
|
|
|
RUN chown spreedbackend /config
|
|
|
|
|
|
|
|
USER spreedbackend
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
|
|
CMD ["/bin/sh", "-c", "/usr/bin/nextcloud-spreed-signaling -config $CONFIG"]
|