mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
b1e048772c
* chore(deps): update dependency puppeteer to v20 * chore(deps): update dependency jest-puppeteer to v9 --------- Co-authored-by: Gao Sun <gao@silverhand.io>
44 lines
1.1 KiB
Text
44 lines
1.1 KiB
Text
###### [STAGE] Build ######
|
|
FROM node:18-alpine as builder
|
|
WORKDIR /etc/logto
|
|
ENV CI=true
|
|
|
|
# No need for Docker build
|
|
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
|
|
|
### Install toolchain ###
|
|
RUN npm add --location=global pnpm@^8.0.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 ###
|
|
RUN node .scripts/update-parcelrc.js
|
|
RUN pnpm i
|
|
|
|
### Build ###
|
|
# Admin Console build env
|
|
ENV CONSOLE_PUBLIC_URL=/
|
|
ENV IS_CLOUD=1
|
|
ARG applicationinsights_connection_string
|
|
ENV APPLICATIONINSIGHTS_CONNECTION_STRING=${applicationinsights_connection_string}
|
|
RUN pnpm prepack
|
|
RUN pnpm connectors:build && pnpm -r --filter @logto/console --filter @logto/cloud build
|
|
|
|
### Add official connectors ###
|
|
RUN pnpm cli connector link -p .
|
|
|
|
### Prune dependencies for production ###
|
|
RUN rm -rf node_modules packages/**/node_modules
|
|
RUN NODE_ENV=production pnpm i
|
|
|
|
### Clean up ###
|
|
RUN rm -rf .scripts .parcel-cache pnpm-*.yaml
|
|
|
|
###### [STAGE] Seal ######
|
|
FROM node:18-alpine as app
|
|
WORKDIR /etc/logto-cloud
|
|
COPY --from=builder /etc/logto .
|
|
EXPOSE 3003
|
|
ENTRYPOINT ["npm", "run", "start:cloud"]
|