forked from t2bot/matrix-media-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (28 loc) · 931 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ---- Stage 0 ----
# Builds media repo binaries
FROM golang:1.18-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git musl-dev dos2unix build-base
WORKDIR /opt
COPY . /opt
RUN dos2unix ./build.sh ./docker/run.sh
RUN ./build.sh
# ---- Stage 1 ----
# Final runtime stage.
FROM alpine
RUN mkdir /plugins
COPY --from=builder /opt/bin/plugin_antispam_ocr /plugins/
COPY --from=builder /opt/bin/media_repo /opt/bin/import_synapse /opt/bin/export_synapse_for_import /opt/bin/gdpr_export /opt/bin/gdpr_import /opt/bin/s3_consistency_check /usr/local/bin/
RUN apk add --no-cache \
su-exec \
ca-certificates \
dos2unix \
imagemagick \
ffmpeg
COPY ./config.sample.yaml /etc/media-repo.yaml.sample
COPY ./docker/run.sh /usr/local/bin/
RUN dos2unix /usr/local/bin/run.sh
ENV REPO_CONFIG=/data/media-repo.yaml
CMD /usr/local/bin/run.sh
VOLUME ["/data", "/media"]
EXPOSE 8000