xlqx/Dockerfile
2025-11-18 10:04:12 +08:00

26 lines
555 B
Docker

FROM node:22.17.1-alpine
LABEL maintainer="windowbird"
ENV NODE_ENV=production \
NUXT_HOST=0.0.0.0 \
PORT=3012
#5、容器内创建目录/nuxt4
RUN mkdir -p /nuxt4
#6、复制当前的内容到容器内容部目录/nuxt4
COPY . ./nuxt4
#7、切换工作目录到/nuxt4
WORKDIR /nuxt4
# 健康检查
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:3012/_nuxt/health || exit 1
# 暴露端口
EXPOSE 3012
# 启动命令(显式指定端口)
CMD ["node", "./server/index.mjs", "--port", "3012", "--host", "0.0.0.0"]