nodemodules added to repo
This commit is contained in:
parent
b0d639996b
commit
e236190aaa
@ -3,8 +3,7 @@ FROM docker.arvancloud.ir/library/node:22-alpine AS app-builder
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.arvancloud.ir/g' /etc/apk/repositories && \
|
||||
apk add --no-cache openssl
|
||||
WORKDIR /app
|
||||
COPY frontend/application/package*.json ./
|
||||
RUN npm config set registry https://registry.npmmirror.com && npm install
|
||||
# Copy everything including node_modules
|
||||
COPY frontend/application ./
|
||||
RUN npm run build
|
||||
|
||||
@ -13,14 +12,12 @@ FROM docker.arvancloud.ir/library/node:22-alpine AS admin-builder
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.arvancloud.ir/g' /etc/apk/repositories && \
|
||||
apk add --no-cache openssl
|
||||
WORKDIR /app
|
||||
COPY frontend/admin-panel/package*.json ./
|
||||
RUN npm config set registry https://registry.npmmirror.com && npm install
|
||||
# Copy everything including node_modules
|
||||
COPY frontend/admin-panel ./
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM docker.arvancloud.ir/nginxinc/nginx-unprivileged:alpine
|
||||
# No need for apk add here unless needed by nginx, but let's keep it clean
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY --from=app-builder /app/.next ./.next
|
||||
COPY --from=app-builder /app/public ./public
|
||||
|
||||
@ -1,36 +1,33 @@
|
||||
# Build stage for Backend
|
||||
FROM docker.arvancloud.ir/library/node:22-alpine AS builder
|
||||
|
||||
# Use ArvanCloud Alpine mirror to fix TLS/timeout issues
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.arvancloud.ir/g' /etc/apk/repositories && \
|
||||
apk add --no-cache openssl
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
# Using mirror for npm as well
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
RUN npm ci
|
||||
|
||||
# Copy all files including node_modules
|
||||
COPY . .
|
||||
|
||||
# Generate prisma client using the existing node_modules
|
||||
RUN npx prisma generate
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
# Production image
|
||||
FROM docker.arvancloud.ir/library/node:22-alpine
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.arvancloud.ir/g' /etc/apk/repositories && \
|
||||
apk add --no-cache openssl
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
RUN npm ci --only=production
|
||||
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder /app/node_modules/@prisma/client ./node_modules/@prisma/client
|
||||
# Copy everything needed for production
|
||||
COPY package*.json ./
|
||||
COPY node_modules ./node_modules
|
||||
COPY dist ./dist
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
USER node
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "dist/main"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user