summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorTakuya Yoshida <hawaiianphoto@geekhost.net>2022-12-22 14:30:35 +0900
committerGitHub <noreply@github.com>2022-12-22 14:30:35 +0900
commit9314ceae3657649f442179f81cb9613fe8a1ea30 (patch)
tree71e59fcc773a7933275cb5948930e8ad9b21765f /Dockerfile
parentenhance(client): update emoji picker immediately on all input (#9385) (diff)
downloadmisskey-9314ceae3657649f442179f81cb9613fe8a1ea30.tar.gz
misskey-9314ceae3657649f442179f81cb9613fe8a1ea30.tar.bz2
misskey-9314ceae3657649f442179f81cb9613fe8a1ea30.zip
Improve Dockerfile (#9105)
* Improve Dockerfile * Update base image * Add copy layer * Delete unused RUN * Update Dockerfile Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile24
1 files changed, 18 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 7a80739e2c..de9ec3e1c7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,23 +2,35 @@ FROM node:18.12.1-bullseye AS builder
ARG NODE_ENV=production
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ build-essential
+
WORKDIR /misskey
+COPY [".yarnrc.yml", "package.json", "yarn.lock", "./"]
+COPY [".yarn", "./.yarn"]
+COPY ["scripts", "./scripts"]
+COPY ["packages/backend/package.json", "./packages/backend/"]
+COPY ["packages/client/package.json", "./packages/client/"]
+COPY ["packages/sw/package.json", "./packages/sw/"]
+
+RUN yarn install --immutable
+
COPY . ./
-RUN apt-get update
-RUN apt-get install -y build-essential
RUN git submodule update --init
-RUN yarn install --immutable
RUN yarn build
-RUN rm -rf .git
FROM node:18.12.1-bullseye-slim AS runner
WORKDIR /misskey
-RUN apt-get update
-RUN apt-get install -y ffmpeg tini
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ ffmpeg tini \
+ && apt-get -y clean \
+ && rm -rf /var/lib/apt/lists/*
COPY --from=builder /misskey/.yarn/install-state.gz ./.yarn/install-state.gz
COPY --from=builder /misskey/node_modules ./node_modules