Fix Dockerfiler
This commit is contained in:
parent
7d63cac3b9
commit
9eae1d21b6
1 changed files with 5 additions and 14 deletions
19
Dockerfile
19
Dockerfile
|
|
@ -1,24 +1,15 @@
|
||||||
FROM node:lts-alpine AS build
|
FROM node:lts-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk add --no-cache openssl
|
||||||
|
|
||||||
# Copy only package files and install deps
|
# Copy only package files and install deps
|
||||||
# This layer will be cached as long as package*.json don't change
|
# This layer will be cached as long as package*.json don't change
|
||||||
COPY package*.json package-lock.json* ./
|
COPY package*.json package-lock.json* ./
|
||||||
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
|
RUN npm ci
|
||||||
|
|
||||||
# Copy the rest of your source
|
# Copy the rest of the source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
FROM node:lts-alpine
|
|
||||||
|
|
||||||
RUN apk add --no-cache openssl
|
|
||||||
|
|
||||||
USER node:node
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=build /app .
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
Loading…
Add table
Add a link
Reference in a new issue