diff --git a/.dockerignore b/.dockerignore index 6ed48a9..5b41fe6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .env node_modules +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fe4921c..993acb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ FROM node:lts-alpine -# add project files to /app -ADD ./ /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 -# install node dependencies -RUN npm install -EXPOSE 8080 +EXPOSE 8080 \ No newline at end of file