added packages into dockploy
This commit is contained in:
+10
-25
@@ -1,32 +1,17 @@
|
||||
# ایمیج اجرا: dist از گیت میآید، فقط dependencyهای production نصب میشود
|
||||
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
FROM node:22-alpine
|
||||
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||
# همان Dockerfile: runtime باندلشده از گیت، بدون npm
|
||||
ARG NODE_IMAGE=node:22-bookworm
|
||||
FROM ${NODE_IMAGE}
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NPM_CONFIG_REGISTRY=${NPM_REGISTRY}
|
||||
ENV TZ=Asia/Tehran
|
||||
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/runtime/libquery_engine-debian-openssl-3.0.x.so.node
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
COPY prisma ./prisma
|
||||
COPY prisma.config.ts ./
|
||||
|
||||
RUN set -eux; \
|
||||
mirror="$(echo "${NPM_REGISTRY}" | sed 's:/*$::')"; \
|
||||
sed -i \
|
||||
-e "s|https://registry.npmjs.org|${mirror}|g" \
|
||||
-e "s|https://registry.npmmirror.com|${mirror}|g" \
|
||||
package-lock.json; \
|
||||
npm config set registry "${mirror}"; \
|
||||
npm ci --omit=dev --no-audit --no-fund; \
|
||||
npm install prisma ts-node typescript --no-save --no-audit --no-fund --registry="${mirror}"; \
|
||||
npx prisma generate
|
||||
|
||||
# بیلد لوکال که داخل گیت است
|
||||
COPY dist ./dist
|
||||
COPY docker-entrypoint.sh ./
|
||||
RUN chmod +x docker-entrypoint.sh
|
||||
COPY runtime ./runtime
|
||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
RUN chmod +x /app/docker-entrypoint.sh \
|
||||
&& test -f /app/runtime/server.cjs \
|
||||
&& test -f /app/runtime/libquery_engine-debian-openssl-3.0.x.so.node
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user