提交 7966ed20 作者: ZhangLingKun

测试:测试推送部署

上级 c9e171c4
流水线 #7169 已失败 于阶段
in 3 秒
...@@ -16,15 +16,31 @@ RUN \ ...@@ -16,15 +16,31 @@ RUN \
else echo "env PROFILES_ACTIVE !=development. exec yarn run build" && yarn run build; \ else echo "env PROFILES_ACTIVE !=development. exec yarn run build" && yarn run build; \
fi fi
# nginx # If using npm comment out above and use below instead
FROM nginx:alpine as production # RUN npm run build
VOLUME ["/var/log/nginx/"]
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone # Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
# Set working directory to nginx asset directory # Uncomment the following line in case you want to disable telemetry during runtime.
COPY --from=builder /app/dist /usr/share/nginx/html # ENV NEXT_TELEMETRY_DISABLED 1
#COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf RUN addgroup --system --gid 1001 nodejs
EXPOSE 80 RUN adduser --system --uid 1001 nextjs
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"] COPY --from=builder /app/public ./public
\ No newline at end of file
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论