dockerfiles/dendrite/Dockerfile

34 lines
1.0 KiB
Docker
Raw Normal View History

2021-04-13 15:36:59 +02:00
FROM golang:1.16.3-alpine3.13 AS builder
RUN apk --no-cache add git build-base && \
mkdir -p /build && \
git clone https://github.com/matrix-org/dendrite /build/dendrite && \
mkdir -p /build/bin && \
cd /build/dendrite && \
go build -trimpath -o /build/bin/ ./cmd/dendrite-monolith-server && \
go build -trimpath -o /build/bin/ ./cmd/goose && \
go build -trimpath -o /build/bin/ ./cmd/create-account && \
go build -trimpath -o /build/bin/ ./cmd/generate-keys
FROM alpine:3.13
2021-04-13 15:51:33 +02:00
COPY --from=builder /build/bin/* /usr/local/bin/
2021-04-13 15:36:59 +02:00
COPY entrypoint.sh /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint && \
addgroup --gid 10001 dendrite && \
adduser \
--uid 10000 \
2021-04-15 09:24:46 +02:00
--home /var/lib/dendrite \
2021-04-13 15:36:59 +02:00
--ingroup dendrite \
--disabled-password \
--shell /sbin/nologin \
dendrite && \
2021-04-15 09:24:46 +02:00
mkdir -p /var/log/dendrite /var/dendrite/media && \
chown -R dendrite:dendrite /var/log/dendrite /var/dendrite
2021-04-13 15:36:59 +02:00
WORKDIR /etc/dendrite
USER dendrite
ENTRYPOINT ["/usr/local/bin/entrypoint"]