FROM node:lts-alpine AS runtime
WORKDIR /app

# 提供一个很小很小的 init 进程
RUN apk add --no-cache tini

COPY package*.json .

RUN npm install

COPY . .

RUN npm run build

ENV HOST=0.0.0.0
ENV PORT=4321

ENTRYPOINT [ "/sbin/tini", "--" ]

CMD ["node", "./dist/server/entry.mjs"]

