2026-09-09 19:58:28 +03:30
|
|
|
FROM node:20
|
2026-09-09 18:29:16 +03:30
|
|
|
|
2026-09-09 17:45:23 +03:30
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY package.json package-lock.json ./
|
2026-09-09 18:29:16 +03:30
|
|
|
COPY scripts ./scripts
|
|
|
|
|
|
2026-09-09 20:12:28 +03:30
|
|
|
ENV NPM_CONFIG_REGISTRY=https://mirror2.chabokan.net
|
|
|
|
|
RUN npm config set registry https://mirror2.chabokan.net/npm/ \
|
2026-09-09 20:06:18 +03:30
|
|
|
&& npm config set replace-registry-host always \
|
|
|
|
|
&& npm config set fetch-retry-mintimeout 10000 \
|
2026-09-09 18:29:16 +03:30
|
|
|
&& npm config set fetch-retry-maxtimeout 120000 \
|
|
|
|
|
&& npm config set fetch-timeout 120000 \
|
2026-09-09 20:06:18 +03:30
|
|
|
&& npm config set fetch-retries 5 \
|
|
|
|
|
&& npm config set progress true \
|
|
|
|
|
&& npm config set loglevel info
|
2026-09-09 18:29:16 +03:30
|
|
|
|
|
|
|
|
ENV NODE_ENV=development
|
2026-09-09 20:16:46 +03:30
|
|
|
RUN npm ci --include=dev --foreground-scripts --no-audit --no-fund --registry=https://mirror2.chabokan.net
|
2026-09-09 17:45:23 +03:30
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2026-09-09 18:29:16 +03:30
|
|
|
# نامها باید با Environment و Build-time Arguments در Dokploy یکی باشند
|
2026-09-09 19:58:28 +03:30
|
|
|
ARG VITE_API_BASE_URL
|
|
|
|
|
ARG VITE_USE_MOCK_AUTH
|
2026-09-09 18:29:16 +03:30
|
|
|
ARG VITE_BASE_PATH
|
|
|
|
|
|
|
|
|
|
RUN node scripts/write-docker-vite-env.mjs \
|
2026-09-09 19:58:28 +03:30
|
|
|
&& unset VITE_API_BASE_URL VITE_USE_MOCK_AUTH VITE_BASE_PATH \
|
2026-09-09 18:29:16 +03:30
|
|
|
&& npm run build
|
|
|
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
2026-09-09 19:58:28 +03:30
|
|
|
ENV VITE_BASE_PATH=/
|
2026-09-09 18:29:16 +03:30
|
|
|
ENV PORT=7676
|
|
|
|
|
|
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
|
|
|
|
|
|
EXPOSE 7676
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
2026-09-09 19:58:28 +03:30
|
|
|
CMD ["node", "scripts/serve-user.mjs"]
|