0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/Dockerfile
wangsijie e5f8139880
chore: merge master into sie-v2 (#2182)
Co-authored-by: Xiao Yijun <xiaoyijun@silverhand.io>
Co-authored-by: IceHe <icehe@silverhand.io>
Co-authored-by: Gao Sun <gao@silverhand.io>
Co-authored-by: simeng-li <simeng@silverhand.io>
Co-authored-by: Charles Zhao <charleszhao@silverhand.io>
Co-authored-by: Mahesh Vagicherla <59088937+b4s36t4@users.noreply.github.com>
Co-authored-by: FlurryNight <47457170+FlurryNight@users.noreply.github.com>
Co-authored-by: Lukas <lukas@slucky.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-18 15:44:49 +08:00

32 lines
721 B
Docker

# Build stage
FROM node:16-alpine as builder
WORKDIR /etc/logto
ENV CI=true
COPY . .
# Install toolchain
RUN npm add --location=global pnpm@^7.2.1
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
RUN apk add --no-cache python3 make g++
# Install dependencies and build
RUN pnpm i
RUN pnpm -r build
# Add official connectors
WORKDIR /etc/logto
RUN pnpm cli connector add --official
# Prune dependencies for production
RUN rm -rf node_modules packages/*/node_modules
RUN NODE_ENV=production pnpm i
# Clean up
RUN rm -rf .parcel-cache pnpm-*.yaml
# Seal stage
FROM node:16-alpine as app
WORKDIR /etc/logto
COPY --from=builder /etc/logto .
EXPOSE 3001
ENTRYPOINT ["npm", "start"]