-
Notifications
You must be signed in to change notification settings - Fork 79
/
Dockerfile
62 lines (52 loc) · 1.52 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ---- Stage 0 ----
# Builds media repo binaries
FROM golang:1.21-alpine3.18 AS builder
# Install build dependencies
RUN apk add --no-cache git musl-dev dos2unix build-base libde265-dev
WORKDIR /opt
COPY . /opt
# Build libheif manually
RUN apk add --no-cache build-base libtool cmake libjpeg-turbo-dev x265-dev ffmpeg-dev zlib-dev
RUN git clone https://github.com/strukturag/libheif.git
WORKDIR /opt/libheif
RUN git checkout v1.17.6
RUN mkdir build
WORKDIR /opt/libheif/build
RUN cmake --preset=release ..
RUN make
RUN make install
WORKDIR /opt
# Run remaining build steps
RUN dos2unix ./build.sh ./docker/run.sh && chmod 744 ./build.sh
RUN ./build.sh
# ---- Stage 1 ----
# Final runtime stage.
FROM alpine:3.18
RUN mkdir /plugins
RUN apk add --no-cache \
su-exec \
ca-certificates \
dos2unix \
imagemagick \
ffmpeg
COPY --from=builder /opt/bin/plugin_antispam_ocr /plugins/
COPY --from=builder \
/opt/bin/media_repo \
/opt/bin/import_synapse \
/opt/bin/import_dendrite \
/opt/bin/export_synapse_for_import \
/opt/bin/export_dendrite_for_import \
/opt/bin/import_to_synapse \
/opt/bin/gdpr_export \
/opt/bin/gdpr_import \
/opt/bin/s3_consistency_check \
/opt/bin/combine_signing_keys \
/opt/bin/generate_signing_key \
/usr/local/bin/
COPY ./config.sample.yaml /etc/media-repo.yaml.sample
COPY ./docker/run.sh /usr/local/bin/
RUN dos2unix /usr/local/bin/run.sh && chmod 744 /usr/local/bin/run.sh
ENV REPO_CONFIG=/data/media-repo.yaml
CMD /usr/local/bin/run.sh
VOLUME ["/data", "/media"]
EXPOSE 8000