use known working file from another project
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m30s
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m30s
This commit is contained in:
36
Dockerfile
36
Dockerfile
@@ -1,17 +1,37 @@
|
|||||||
FROM node:lts-alpine AS base
|
FROM node:lts-slim AS base
|
||||||
|
|
||||||
# Stage 1: Install dependencies
|
# Create app directory
|
||||||
FROM base AS deps
|
|
||||||
WORKDIR /app
|
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 ./
|
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 . .
|
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
|
EXPOSE 3000
|
||||||
CMD ["yarn", "start"]
|
CMD ["yarn", "start"]
|
||||||
Reference in New Issue
Block a user