Remade dockerfile
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,19 +1,21 @@
|
|||||||
FROM node:lts-slim AS base
|
FROM node:lts-slim AS base
|
||||||
|
|
||||||
|
# Create app directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# Enable Corepack
|
# Enable Corepack
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
# Set Yarn to the latest stable version
|
# Set Yarn to the latest stable version
|
||||||
RUN yarn set version stable
|
RUN yarn set version stable
|
||||||
|
|
||||||
# Create app directory
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Files required by yarn install
|
# Files required by yarn install
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
|
COPY .pnp.cjs .pnp.loader.mjs .yarn/ .yarn/
|
||||||
|
v
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
RUN yarn install
|
RUN yarn install --immutable
|
||||||
|
|
||||||
# Bundle app source
|
# Bundle app source
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -27,7 +29,7 @@ FROM base AS runner
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Install only production app dependencies
|
# Install only production app dependencies
|
||||||
RUN yarn install --frozen-lockfile
|
RUN yarn install --immutable
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user