0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/Dockerfile

37 lines
819 B
Text
Raw Normal View History

# Build stage
2023-01-03 02:39:58 -05:00
FROM node:18-alpine as builder
WORKDIR /etc/logto
ENV CI=true
# No need for build
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Install toolchain
2022-11-07 06:28:34 -05:00
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++
2022-11-07 06:28:34 -05:00
COPY . .
# Install dependencies and build
RUN node .scripts/update-parcelrc.js
RUN pnpm i
2022-10-17 06:37:59 -05:00
RUN pnpm -r build
# Add official connectors
RUN pnpm cli connector add --official -p .
# Prune dependencies for production
2022-12-14 00:23:59 -05:00
RUN rm -rf node_modules packages/**/node_modules
RUN NODE_ENV=production pnpm i
# Clean up
RUN rm -rf .scripts .parcel-cache pnpm-*.yaml
# Seal stage
2023-01-03 02:39:58 -05:00
FROM node:18-alpine as app
WORKDIR /etc/logto
COPY --from=builder /etc/logto .
EXPOSE 3001
ENTRYPOINT ["npm", "start"]