33 lines
711 B
Docker
33 lines
711 B
Docker
# 1. Build stage
|
|
FROM node:22-slim AS builder
|
|
|
|
ENV NVM_DIR=/root/.nvm
|
|
ENV NODE_VERSION=22
|
|
|
|
# Install dependencies for Node
|
|
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y ca-certificates build-essential
|
|
|
|
# Enable corepack and prepare pnpm
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN yes | pnpm install
|
|
|
|
RUN pnpm turbo run build --filter=lightsaver_user_client...
|
|
|
|
#debugging
|
|
RUN ls -al /app/apps/lightsaver_user_client
|
|
|
|
# 2. Production stage
|
|
FROM node:22-slim
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/apps/lightsaver_user_client ./
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/packages ./packages
|
|
|
|
EXPOSE 3000 |