| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | # 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 3000# set timezoneENV TZ UTCRUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \    && echo ${TZ} > /etc/timezone# global runtime packagesRUN yarn global add pm2 \    && yarn cache cleanWORKDIR /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.shARG COMMIT_SHAENV COMMIT_SHA ${COMMIT_SHA}EXPOSE 3000ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
 |