0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/Dockerfile.cloud
2023-02-21 10:44:35 +08:00

31 lines
741 B
Text

# Build stage
FROM node:18-alpine as builder
WORKDIR /etc/logto
ENV CI=true
# No need for build
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Install toolchain
RUN npm add --location=global pnpm@^7.14.0
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
RUN apk add --no-cache python3 make g++
COPY . .
# Install dependencies and build
RUN node .scripts/update-parcelrc.js
RUN pnpm i
RUN pnpm prepack
RUN cd packages/cloud && pnpm build
# Prune dependencies for production
RUN rm -rf node_modules packages/**/node_modules
RUN NODE_ENV=production pnpm i
# Seal stage
FROM node:18-alpine as app
WORKDIR /etc/logto
COPY --from=builder /etc/logto/packages/cloud .
EXPOSE 3003
ENTRYPOINT ["npm", "start"]