From 0e9de8deb5c6d24a2d011676d22c89f2aaad7bc9 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 25 Sep 2024 15:01:18 +0000 Subject: [PATCH] Fix env issue --- Dockerfile | 6 ++---- scripts/build.sh | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8df76bc..4b37cf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,7 @@ COPY package*.json tsconfig.json .npmrc ./ # Install ARG NPM_TOKEN -ENV NPM_TOKEN ${NPM_TOKEN} -RUN npm install +RUN npm install --//npm.token=${NPM_TOKEN} # Copy the app COPY src ./src @@ -32,8 +31,7 @@ FROM node:lts-alpine # Install dependencies but skip dev dependencies COPY --from=build /app/package*.json /app/.npmrc ./ ARG NPM_TOKEN -ENV NPM_TOKEN ${NPM_TOKEN} -RUN npm install --only=production +RUN npm install --only=production --//npm.token=${NPM_TOKEN} # Copy the app COPY --from=build /app/dist ./dist diff --git a/scripts/build.sh b/scripts/build.sh index ab268ca..20a2d9f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -51,7 +51,8 @@ fi # cd to the project root directory. cd "$(dirname "$0")/.." -docker build -t butlerbot:$VERSION . +source .env +docker build --build-arg NPM_TOKEN=$NPM_TOKEN -t butlerbot:$VERSION . # Tag the Docker image. for TAG in "${TAGS[@]}"; do