forked from mei23/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-ubuntu
72 lines (55 loc) · 1.9 KB
/
Dockerfile-ubuntu
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
FROM ubuntu:24.04 as builder
# Use bash for the shell
SHELL ["/bin/bash", "-c"]
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
ENV NODE_ENV=production
ENV NODE_VER="20.12.2"
RUN ARCH= && \
dpkgArch="$(dpkg --print-architecture)" && \
case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac && \
echo "Etc/UTC" > /etc/localtime && \
apt-get update && \
apt-get install -y --no-install-recommends build-essential ca-certificates wget apt-utils git && \
cd ~ && \
wget -q https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \
tar xf node-v$NODE_VER-linux-$ARCH.tar.gz && \
rm node-v$NODE_VER-linux-$ARCH.tar.gz && \
mv node-v$NODE_VER-linux-$ARCH /opt/node
ENV PATH="${PATH}:/opt/node/bin"
WORKDIR /misskey
COPY package.json pnpm-lock.yaml ./
RUN corepack enable pnpm
RUN pnpm i --frozen-lockfile
COPY . ./
RUN pnpm build
FROM ubuntu:24.04
WORKDIR /misskey
# Copy over all the langs needed for runtime
COPY --from=builder /opt/node /opt/node
# Add more PATHs to the PATH
ENV PATH="${PATH}:/opt/node/bin"
# Install misskey runtime deps
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && \
apt-get -y --no-install-recommends install \
ffmpeg mecab mecab-ipadic-utf8 tini wget && \
rm -rf /var/cache && \
rm -rf /var/lib/apt/lists/*
# Copy over misskey source, and dependencies from building
RUN corepack enable pnpm
COPY --from=builder /misskey/node_modules ./node_modules
COPY --from=builder /misskey/built ./built
COPY . ./
# Run misskey services in prod mode
ENV NODE_ENV="production"
# Set the container entry point
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["pnpm", "run", "start"]