test: new dockerfile for dev

This commit is contained in:
Marie 2023-11-08 20:26:27 +01:00 committed by GitHub
parent 82bfef9069
commit c78765400e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,10 +36,7 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
COPY --link . ./
ARG NODE_ENV=production
RUN git submodule update --init
RUN pnpm build
RUN rm -rf .git/
# build native dependencies for target platform
@ -58,6 +55,9 @@ COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"]
COPY --link ["scripts", "./scripts"]
COPY --link ["packages/megalodon/package.json", "./packages/megalodon/"]
COPY --link ["packages/backend/package.json", "./packages/backend/"]
COPY --link ["packages/frontend/package.json", "./packages/frontend/"]
COPY --link ["packages/sw/package.json", "./packages/sw/"]
COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"]
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm i --frozen-lockfile --aggregate-output
@ -85,16 +85,20 @@ WORKDIR /sharkey
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/node_modules ./node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/megalodon/node_modules ./packages/megalodon/node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/backend/node_modules ./packages/backend/node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/frontend/node_modules ./packages/frontend/node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/sw/node_modules ./packages/sw/node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/misskey-js/node_modules ./packages/misskey-js/node_modules
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/sw ./packages/sw
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/misskey-js ./packages/misskey-js
COPY --chown=sharkey:sharkey --from=native-builder /ffmpeg /usr/local/bin/
COPY --chown=sharkey:sharkey --from=native-builder /ffprobe /usr/local/bin/
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/built ./built
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/megalodon/lib ./packages/megalodon/lib
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/backend/built ./packages/backend/built
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/frontend ./packages/frontend
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/megalodon ./packages/megalodon
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/backend ./packages/backend
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/fluent-emojis /sharkey/fluent-emojis
COPY --chown=sharkey:sharkey . ./
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
ENV NODE_ENV=production
VOLUME "/sharkey/files"
HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/sharkey/healthcheck.sh"]
ENTRYPOINT ["/usr/bin/tini", "--"]