| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | # base imageFROM node:20.11-alpine3.19 AS baseLABEL maintainer="takatost@gmail.com"# if you located in China, you can use aliyun mirror to speed up# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositoriesRUN apk add --no-cache tzdata# install packagesFROM base AS packagesWORKDIR /app/webCOPY package.json .COPY yarn.lock .# if you located in China, you can use taobao registry to speed up# RUN yarn install --frozen-lockfile --registry https://registry.npmmirror.com/RUN yarn install --frozen-lockfile# build resourcesFROM base AS builderWORKDIR /app/webCOPY --from=packages /app/web/ .COPY . .RUN yarn build# production stageFROM base AS productionENV NODE_ENV=productionENV EDITION=SELF_HOSTEDENV DEPLOY_ENV=PRODUCTIONENV CONSOLE_API_URL=http://127.0.0.1:5001ENV APP_API_URL=http://127.0.0.1:5001ENV PORT=3000ENV NEXT_TELEMETRY_DISABLED=1# set timezoneENV TZ=UTCRUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \    && echo ${TZ} > /etc/timezoneWORKDIR /app/webCOPY --from=builder /app/web/public ./publicCOPY --from=builder /app/web/.next/standalone ./COPY --from=builder /app/web/.next/static ./.next/staticCOPY docker/pm2.json ./pm2.jsonCOPY docker/entrypoint.sh ./entrypoint.sh# global runtime packagesRUN yarn global add pm2 \    && yarn cache clean \    && mkdir /.pm2 \    && chown -R 1001:0 /.pm2 /app/web \    && chmod -R g=u /.pm2 /app/webARG COMMIT_SHAENV COMMIT_SHA=${COMMIT_SHA}USER 1001EXPOSE 3000ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
 |