forked from mei23/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-fedora
56 lines (44 loc) · 1.49 KB
/
Dockerfile-fedora
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
FROM fedora:40 AS builder
ENV NODE_ENV=production
WORKDIR /misskey
RUN dnf update -y \
&& dnf groupinstall -y "Development Tools" \
&& dnf install -y wget gcc-c++
ENV NODE_VER="20.12.2"
RUN ARCH= && \
unameArch="$(uname -m)" && \
case "${unameArch##*-}" in \
x86_64) ARCH='x64';; \
aarch64) ARCH='arm64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac && \
echo "Etc/UTC" > /etc/localtime && \
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"
COPY package.json pnpm-lock.yaml ./
RUN corepack enable pnpm
RUN pnpm i --frozen-lockfile
COPY . ./
RUN pnpm build
FROM fedora:40 AS runner
WORKDIR /misskey
RUN dnf update -y \
&& dnf install -y \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm \
&& dnf install -y ffmpeg mecab tini wget
COPY --from=builder /misskey/node_modules ./node_modules
COPY --from=builder /misskey/built ./built
# Copy over all the langs needed for runtime
COPY --from=builder /opt/node /opt/node
COPY . ./
# Add more PATHs to the PATH
ENV PATH="${PATH}:/opt/node/bin"
RUN corepack enable pnpm
ENV NODE_ENV=production
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["pnpm", "start"]