File tree Expand file tree Collapse file tree 5 files changed +14
-18
lines changed
Expand file tree Collapse file tree 5 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 22#
33# SPDX-License-Identifier: CC0-1.0
44
5- .git
65node_modules
76config
87lib
Original file line number Diff line number Diff line change 3030 uses : actions/checkout@v4
3131 - name : Unshallow for git describe so we can create version.txt
3232 run : git fetch --prune --unshallow --tags --all --force
33- - name : Prepare version file
34- run : git describe > version.txt
3533
3634 # Needed for multi platform builds
3735 - name : Set up QEMU
Original file line number Diff line number Diff line change 3030 run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3131 - name : Unshallow for git describe so we can create version.txt
3232 run : git fetch --prune --unshallow --tags --all --force
33- - name : Prepare version file
34- run : git describe > version.txt
35-
3633 # Needed for multi platform builds
3734 - name : Set up QEMU
3835 uses : docker/setup-qemu-action@v3
Original file line number Diff line number Diff line change 3030 run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3131 - name : Unshallow for git describe so we can create version.txt
3232 run : git fetch --prune --unshallow --tags --all --force
33- - name : Prepare version file
34- run : git describe > version.txt
3533
3634 # Needed for multi platform builds
3735 - name : Set up QEMU
Original file line number Diff line number Diff line change 33#
44# SPDX-License-Identifier: Apache-2.0 AND AFL-3.0
55
6- # We can't use alpine anymore because crypto has rust deps.
7- FROM node:20-slim
6+ FROM node:20-slim as build-stage
7+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
88COPY . /tmp/src
9+ # describe the version.
10+ RUN cd /tmp/src && git describe > version.txt.tmp && mv version.txt.tmp version.txt
11+ # build and install
912RUN cd /tmp/src \
10- && yarn install --network-timeout 100000 \
13+ && yarn install --frozen-lockfile -- network-timeout 100000 \
1114 && yarn build \
12- && mv lib/ /draupnir/ \
13- && mv node_modules / \
14- && mv draupnir-entrypoint.sh / \
15- && mv package.json / \
16- && mv version.txt / \
17- && cd / \
18- && rm -rf /tmp/*
15+ && yarn install --frozen-lockfile --production --network-timeout 100000
16+
17+ FROM node:20-slim as final-stage
18+ COPY --from=build-stage /tmp/src/version.txt version.txt
19+ COPY --from=build-stage /tmp/src/lib/ /draupnir/
20+ COPY --from=build-stage /tmp/src/node_modules /node_modules
21+ COPY --from=build-stage /tmp/src/draupnir-entrypoint.sh /
22+ COPY --from=build-stage /tmp/src/package.json /
1923
2024ENV NODE_ENV=production
2125ENV NODE_CONFIG_DIR=/data/config
You can’t perform that action at this time.
0 commit comments