-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.streaming
48 lines (37 loc) · 1.23 KB
/
Dockerfile.streaming
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
ARG TARGETPLATFORM=${TARGETPLATFORM}
ARG BUILDPLATFORM=${BUILDPLATFORM}
# Node version to use in base image.
ARG NODE_MAJOR="22"
# Debian image to use for base image.
ARG DEBIAN_VERSION="bookworm"
FROM --platform=${TARGETPLATFORM} docker.io/node:${NODE_MAJOR}-${DEBIAN_VERSION}-slim AS streaming
ARG UID="991"
ARG GID="991"
ENV BIND="0.0.0.0"
ENV NODE_ENV="production"
RUN groupadd -g ${GID} mastodon && \
useradd -l -u "${UID}" -g "${GID}" -m -d /opt/mastodon mastodon && \
ln -s /opt/mastodon /mastodon
RUN echo "Etc/UTC" > /etc/localtime && \
apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
tzdata \
wget \
git
WORKDIR /opt/mastodon
RUN rm .profile && \
git config --global --add safe.directory /opt/mastodon && \
git config --global init.defaultBranch main && \
git init && \
git remote add origin https://github.com/glitch-soc/mastodon.git && \
git pull origin main
RUN rm /usr/local/bin/yarn* ; \
corepack enable && \
corepack prepare --activate
RUN yarn workspaces focus --production @mastodon/streaming
USER mastodon
EXPOSE 4000
CMD ["/usr/local/bin/node", "./streaming/index.js"]