mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-06-04 06:41:18 +00:00
Make Dockerfile more reliable for multiarch
This commit is contained in:
+11
-12
@@ -1,20 +1,19 @@
|
||||
# We can't use alpine anymore because crypto has rust deps.
|
||||
FROM node:18-slim
|
||||
FROM --platform=$BUILDPLATFORM node:18-slim AS build
|
||||
# install git
|
||||
RUN apt-get update && \
|
||||
apt-get install -y git\
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY . /tmp/src
|
||||
RUN cd /tmp/src \
|
||||
&& yarn install --network-timeout 100000 \
|
||||
&& yarn build \
|
||||
&& mv lib/ /mjolnir/ \
|
||||
&& mv node_modules / \
|
||||
&& mv mjolnir-entrypoint.sh / \
|
||||
&& mv package.json / \
|
||||
&& mv version.txt / \
|
||||
&& cd / \
|
||||
&& rm -rf /tmp/*
|
||||
COPY . .
|
||||
RUN yarn install --network-timeout 100000 \
|
||||
&& yarn build
|
||||
|
||||
FROM node:18-slim
|
||||
|
||||
COPY --from=build /lib /mjolnir
|
||||
COPY --from=build /node_modules /node_modules
|
||||
COPY --from=build mjolnir-entrypoint.sh .
|
||||
COPY --from=build version.txt .
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_CONFIG_DIR=/data/config
|
||||
|
||||
Reference in New Issue
Block a user