dockerfile changes
This commit is contained in:
1 parent
508356b8d3
commit
b0d639996b
2 files changed
+36
-32
No files matched your search
+26
-1
@@ -1,5 +1,30 @@
|
||||
# Build stage for Frontend Application
|
||||
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 frontend/application ./
|
||||
RUN npm run build
|
||||
|
||||
# Build stage for Admin Panel
|
||||
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 frontend/admin-panel ./
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM docker.arvancloud.ir/nginxinc/nginx-unprivileged:alpine
|
||||
COPY dist /usr/share/nginx/html
|
||||
# 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
|
||||
COPY --from=admin-builder /app/dist ./admin
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 8080
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in new issue
Block a user