This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
*.md
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
coverage
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
+20
-7
@@ -1,22 +1,35 @@
|
|||||||
# مرحله اول: Builder
|
# Stage 1: Build
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
# کپی فایلهای اصلی
|
ARG NPM_REGISTRY=https://mirror-npm.runflare.com
|
||||||
|
|
||||||
|
# Vite embeds these at build time
|
||||||
|
ARG VITE_BASE_URL=https://dmenu-api.danakcorp.com
|
||||||
|
ARG VITE_SOCKET_URL=https://dmenu-api.danakcorp.com
|
||||||
|
ARG VITE_TOKEN_NAME=dmnu_a_t
|
||||||
|
ARG VITE_REFRESH_TOKEN_NAME=dmnu-a-rt
|
||||||
|
|
||||||
|
ENV VITE_BASE_URL=$VITE_BASE_URL \
|
||||||
|
VITE_SOCKET_URL=$VITE_SOCKET_URL \
|
||||||
|
VITE_TOKEN_NAME=$VITE_TOKEN_NAME \
|
||||||
|
VITE_REFRESH_TOKEN_NAME=$VITE_REFRESH_TOKEN_NAME
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# استفاده از رجیستری رانفلر با Fallback به رجیستری رسمی (برای اطمینان ۱۰۰٪)
|
RUN npm ci --registry="${NPM_REGISTRY}"
|
||||||
RUN npm ci --registry=https://mirror-npm.runflare.com || npm ci --registry=https://registry.npmjs.org
|
|
||||||
|
|
||||||
# کپی بقیه کدها و بیلد
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# مرحله دوم: Serving با Nginx
|
# Stage 2: Serve with Nginx
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
# کپی فایلهای تولید شده به Nginx
|
|
||||||
COPY --from=builder /build/dist /usr/share/nginx/html
|
COPY --from=builder /build/dist /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
Reference in New Issue
Block a user