improve docker build time
This commit is contained in:
parent
09a2bcb3ad
commit
eda9a12443
2 changed files with 10 additions and 6 deletions
|
|
@ -1,2 +1,3 @@
|
||||||
.env
|
.env
|
||||||
node_modules
|
node_modules
|
||||||
|
.git
|
||||||
13
Dockerfile
13
Dockerfile
|
|
@ -1,13 +1,16 @@
|
||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
# add project files to /app
|
|
||||||
ADD ./ /app
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# add open ssl
|
# Copy only package files and install deps
|
||||||
|
# This layer will be cached as long as package*.json don't change
|
||||||
|
COPY package*.json package-lock.json* ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copy the rest of your source
|
||||||
|
COPY . .
|
||||||
|
|
||||||
RUN apk add --no-cache openssl
|
RUN apk add --no-cache openssl
|
||||||
|
|
||||||
# install node dependencies
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
Loading…
Add table
Add a link
Reference in a new issue