Split production node_modules

This commit is contained in:
colinmcneil
2024-12-17 14:56:25 -05:00
committed by Jim Clark
parent 9ff603aef5
commit 4e8a8d270a
14 changed files with 92 additions and 47 deletions

View File

@@ -14,8 +14,11 @@ FROM node:22-alpine AS release
WORKDIR /app
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
ENV NODE_ENV=production
CMD ["node", "dist/index.js"]
RUN npm ci --ignore-scripts --omit-dev
ENTRYPOINT ["node", "dist/index.js"]

View File

@@ -183,9 +183,9 @@ const credentialsPath = process.env.GDRIVE_CREDENTIALS_PATH || path.join(
async function authenticateAndSaveCredentials() {
console.log("Launching auth flow…");
const auth = await authenticate({
keyfilePath: path.join(
keyfilePath: process.env.GDRIVE_OAUTH_PATH || path.join(
path.dirname(new URL(import.meta.url).pathname),
process.env.GDRIVE_OAUTH_PATH || "../../../gcp-oauth.keys.json",
"../../../gcp-oauth.keys.json",
),
scopes: ["https://www.googleapis.com/auth/drive.readonly"],
});