Skip to content

Commit

Permalink
build: fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Oct 24, 2023
1 parent f8833e1 commit 7b1b3c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ README.md
.git
__test__/
node_modules/
packages/
packages/*
!packages/web-app
!packages/packages.txt

13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SHELL ["/bin/bash", "-c"]
RUN mkdir -p /home/node/app && chown -R node:node /home/node/app
WORKDIR /home/node/app
RUN npm i pm2 -g
RUN npm i pnpm -g
# Install required dependecies in a "build-deps" virtual package,
# which can be easily cleaned up after build completes
# Add additional dependencies in the same line if needed
Expand All @@ -23,14 +24,14 @@ RUN npm i pm2 -g
RUN apk add --no-cache --virtual build-deps git lz4 python3 make g++
RUN apk add --no-cache curl
COPY --chown=node:node . .
USER node
# USER node

RUN export GIT_REMOTE_PROTOCOL=https \
&& npm run setup \
&& npm run --silent get_rev > .current_rev \
&& npm run clean_on_prod \
&& (npm i --production || true)
USER root
&& pnpm run setup \
&& pnpm run --silent get_rev > .current_rev \
# && pnpm run clean_on_prod \
# && (pnpm i --production || true)
# USER root
# clean up dependecies from the "build-deps" virtual package
RUN apk del build-deps
USER node
Expand Down

0 comments on commit 7b1b3c3

Please sign in to comment.