From 7981688640309fa54e648bc5496a5b57a04c72ab Mon Sep 17 00:00:00 2001 From: Lucid Date: Fri, 5 Dec 2025 20:20:43 -0500 Subject: [PATCH] use known working file from another project --- Dockerfile | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index a769cb1..7cff5e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,37 @@ -FROM node:lts-alpine AS base +FROM node:lts-slim AS base -# Stage 1: Install dependencies -FROM base AS deps +# Create app directory WORKDIR /app + +# Enable Corepack +RUN corepack enable + +# Set Yarn to the latest stable version +RUN yarn set version stable + +# Files required by yarn install COPY package.json yarn.lock ./ -RUN corepack enable yarn && yarn install --immutable -# Stage 2: Build the application +# Install app dependencies +RUN yarn install --immutable + +# Type check app +# RUN yarn typecheck + +# Bundle app source COPY . . -RUN corepack enable yarn && yarn build -# Stage 3: Production server -ENV NODE_ENV=production +FROM base AS runner + +# Bundle app source +COPY . . + +# Install only production app dependencies +RUN yarn install --immutable + +USER node + +# Start the app EXPOSE 3000 CMD ["yarn", "start"] \ No newline at end of file