1 Star 21 Fork 4

Gitee 极速下载/c-shopping

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/huanghanzhilian/c-shopping
克隆/下载
Dockerfile 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
FROM node:18-alpine as dependencies
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
FROM node:18-alpine as builder
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY ./ ./
COPY ./.env ./
RUN npm run build
FROM node:18-alpine as runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --chown=nextjs:nodejs --from=builder /app/.next ./.next
COPY --from=builder /app/.env ./.env
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER nextjs
ENV MONGODB_URL "mongodb://db:27017/choiceshop"
EXPOSE 3000
# RUN addgroup --system --gid 1001 nodejs
# RUN adduser --system --uid 1001 nextjs
# RUN mkdir -p .next/cache/fetch-cache
# RUN chown -R nextjs:nodejs .next
# USER nextjs
# CMD echo 'Waiting for db service start...' && while ! nc -z db 27017; do sleep 1; done; echo 'Connected!' && npm run build && npm run start
# CMD npm run start
CMD ["node_modules/.bin/next", "start"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/c-shopping.git
[email protected]:mirrors/c-shopping.git
mirrors
c-shopping
c-shopping
main

搜索帮助