diff --git a/Dockerfile b/Dockerfile index 6f00798..18b5e1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,42 +1,37 @@ FROM node:lts-slim AS base +# Create app directory +WORKDIR /app + # Enable Corepack RUN corepack enable # Set Yarn to the latest stable version RUN yarn set version stable -# Create app directory -WORKDIR /usr/src - -FROM base AS builder - -# Files required by npm install -COPY package*.json ./ +# Files required by yarn install +COPY package.json yarn.lock ./ # Install app dependencies -RUN yarn install +RUN yarn install --immutable + +# Type check app +# RUN yarn typecheck # Bundle app source COPY . . -# Type check app -RUN yarn typecheck FROM base AS runner -# Files required by npm install -COPY package.json yarn.lock ./ - -# Install only production app dependencies -RUN yarn install --frozen-lockfile - # Bundle app source COPY . . +# Install only production app dependencies +RUN yarn install --immutable + USER node # Start the app EXPOSE 80 -CMD ["yarn", "start"] -# CMD ["node", "--import", "tsx", "./src/main.ts"] \ No newline at end of file +CMD ["yarn", "start"] \ No newline at end of file