build: update production artifacts and simplify dockerfiles to use pre-built output
This commit is contained in:
+3
-20
@@ -1,25 +1,8 @@
|
||||
# Admin panel (static SPA served by nginx). Build context: repository root.
|
||||
# docker build -f docker/admin.Dockerfile --build-arg SITE_URL=https://imenpishgaman.ir -t imen-admin .
|
||||
ARG NODE_IMAGE=docker.arvancloud.ir/node:24-alpine
|
||||
# Admin panel (static SPA served by nginx). Pre-built output.
|
||||
# docker build -f docker/admin.Dockerfile -t imen-admin .
|
||||
ARG NGINX_IMAGE=docker.arvancloud.ir/nginx:alpine
|
||||
|
||||
FROM ${NODE_IMAGE} AS build
|
||||
ARG NPM_REGISTRY=https://registry.npmjs.org/
|
||||
ENV COREPACK_NPM_REGISTRY=${NPM_REGISTRY} npm_config_registry=${NPM_REGISTRY}
|
||||
# website address for the "view site" links
|
||||
ARG SITE_URL=https://imenpishgaman.ir
|
||||
ENV VITE_SITE_URL=${SITE_URL}
|
||||
RUN corepack enable
|
||||
WORKDIR /repo
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY packages/shared packages/shared
|
||||
COPY apps/admin apps/admin
|
||||
RUN pnpm config set fetch-retries 5 \
|
||||
&& pnpm config set fetch-retry-maxtimeout 120000 \
|
||||
&& pnpm install --frozen-lockfile --filter "@imen/admin..." || pnpm install --no-frozen-lockfile --filter "@imen/admin..."
|
||||
RUN pnpm --filter "@imen/admin..." build
|
||||
|
||||
FROM ${NGINX_IMAGE}
|
||||
COPY docker/nginx/admin.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /repo/apps/admin/dist /usr/share/nginx/html
|
||||
COPY apps/admin/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user