-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-bitnami
76 lines (64 loc) · 3.82 KB
/
Dockerfile-bitnami
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM docker.io/bitnami/minideb:bullseye
ARG TARGETARCH
LABEL com.vmware.cp.artifact.flavor="sha256:109c7d51bd69bb6b3df71017440c1ea0699454f81fe188056c083f0b57c96ea6" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
org.opencontainers.image.created="2023-04-26T18:26:20Z" \
org.opencontainers.image.description="Application packaged by VMware, Inc" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="4.1.2-debian-11-r8" \
org.opencontainers.image.title="mastodon" \
org.opencontainers.image.vendor="VMware, Inc." \
org.opencontainers.image.version="4.1.2"
ENV HOME="/" \
OS_ARCH="${TARGETARCH:-amd64}" \
OS_FLAVOUR="debian-11" \
OS_NAME="linux"
COPY bitnami/prebuildfs /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN install_packages acl ca-certificates curl ffmpeg file imagemagick libbsd0 libbz2-1.0 libcom-err2 libcrypt1 libedit2 libffi7 libgcc-s1 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed6 libicu67 libidn11 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libmd0 libncursesw6 libnettle8 libnsl2 libp11-kit0 libpq5 libreadline-dev libreadline8 libsasl2-2 libsqlite3-0 libssl-dev libssl1.1 libstdc++6 libtasn1-6 libtinfo6 libtirpc3 libunistring2 libuuid1 libxml2 libxslt1.1 procps sqlite3 zlib1g librsvg2-bin
RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \
COMPONENTS=( \
"python-3.9.16-10-linux-${OS_ARCH}-debian-11" \
"wait-for-port-1.0.6-6-linux-${OS_ARCH}-debian-11" \
"ruby-3.0.6-0-linux-${OS_ARCH}-debian-11" \
"redis-client-7.0.11-0-linux-${OS_ARCH}-debian-11" \
"postgresql-client-15.2.0-4-linux-${OS_ARCH}-debian-11" \
"node-16.20.0-1-linux-${OS_ARCH}-debian-11" \
"mastodon-4.1.2-1-linux-${OS_ARCH}-debian-11" \
) && \
for COMPONENT in "${COMPONENTS[@]}"; do \
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz" -O ; \
curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz.sha256" -O ; \
fi && \
sha256sum -c "${COMPONENT}.tar.gz.sha256" && \
tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner --wildcards '*/files' && \
rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \
done
RUN apt-get update && apt-get upgrade -y && \
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Add theme files
COPY app/javascript/ /opt/bitnami/mastodon/app/javascript/
COPY public/ /opt/bitnami/mastodon/public/
# COPY config/themes.yml /opt/bitnami/mastodon/config/themes.yml
RUN echo 'xusix: styles/xusix.scss' >> /opt/bitnami/mastodon/config/themes.yml
# Limit SW cache to same-origin
RUN sed -i 's/({ request }) => request.destination ===/({ request, sameOrigin }) => sameOrigin \&\& request.destination ===/g' /opt/bitnami/mastodon/app/javascript/mastodon/service_worker/entry.js
RUN chmod g+rwX /opt/bitnami
COPY bitnami/rootfs /
ENV APP_VERSION="4.1.2" \
BITNAMI_APP_NAME="mastodon" \
PATH="/opt/bitnami/python/bin:/opt/bitnami/common/bin:/opt/bitnami/ruby/bin:/opt/bitnami/redis/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/node/bin:/opt/bitnami/mastodon/bin:$PATH"
RUN . /opt/bitnami/scripts/liblog.sh && \
. /opt/bitnami/scripts/libos.sh && \
. /opt/bitnami/scripts/libvalidations.sh && \
. /opt/bitnami/scripts/libmastodon.sh && \
. /opt/bitnami/scripts/mastodon-env.sh && \
cd /opt/bitnami/mastodon/ && \
RAILS_ENV=production /opt/bitnami/ruby/bin/bundle exec rake assets:precompile branding:generate
RUN /opt/bitnami/scripts/mastodon/postunpack.sh
EXPOSE 3000
USER 1001
ENTRYPOINT [ "/opt/bitnami/scripts/mastodon/entrypoint.sh" ]
CMD [ "/opt/bitnami/scripts/mastodon/run.sh" ]