From 4df949bc0ce6e5ef13bfea83ed0d6620ca42eaa0 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Fri, 08 Aug 2025 21:02:44 +0000 Subject: [PATCH] fix: dockerfile not getting the envs during build --- Dockerfile | 13 ++++++++++--- 1 file(s) changed, 10 insertion(s)(+), 3 deletion(s)(-) diff --git a/Dockerfile b/Dockerfile --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,15 @@ FROM node:20-alpine AS builder ARG SOURCE_COMMIT +ARG VITE_BOT_API_URL +ARG VITE_STATUS_API_KEY +ARG VITE_FRONTEND_URL + ENV SOURCE_COMMIT=${SOURCE_COMMIT} ENV NODE_ENV=production +ENV VITE_BOT_API_URL=${VITE_BOT_API_URL} +ENV VITE_STATUS_API_KEY=${VITE_STATUS_API_KEY} +ENV VITE_FRONTEND_URL=${VITE_FRONTEND_URL} WORKDIR /app @@ -18,6 +25,7 @@ COPY locales ./locales COPY migrations ./migrations COPY tsconfig.json ./ +COPY .env* ./ RUN pnpm run build @@ -39,7 +47,6 @@ FROM node:20-alpine AS production - RUN addgroup -g 1001 -S nodejs && \ adduser -S aethel -u 1001 @@ -48,6 +55,7 @@ RUN npm install -g pnpm COPY package.json pnpm-lock.yaml ./ +COPY .env* ./ RUN pnpm install --frozen-lockfile --prod && \ pnpm store prune @@ -56,7 +64,6 @@ COPY --from=builder --chown=aethel:nodejs /app/locales ./locales COPY --from=builder --chown=aethel:nodejs /app/migrations ./migrations COPY --from=builder --chown=aethel:nodejs /app/scripts ./scripts - COPY --from=builder --chown=aethel:nodejs /app/web/dist ./web/dist RUN mkdir -p /app/logs && chown aethel:nodejs /app/logs @@ -66,6 +73,6 @@ EXPOSE 2020 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD node -e "process.exit(0)" || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:2020/api/status || exit 1 CMD ["pnpm", "run", "start"] -- tangled.sh