From 1034aa198072a9607f31d230640b6bda197b0453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 May 2020 19:39:34 +0200 Subject: [PATCH 1/4] Don't copy Docker related files into image --- backend/.dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/.dockerignore b/backend/.dockerignore index 99a3d5b..f88c733 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -1,2 +1,4 @@ node_modules -*.exe \ No newline at end of file +*.exe +docker-compose.yml +Dockerfile From a8b188cd2270daef49afbe2056e2711b9915bc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 May 2020 19:40:02 +0200 Subject: [PATCH 2/4] Don't create cache with apk, use cdn network --- backend/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 8e0b2f4..1b297eb 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,8 +1,8 @@ FROM alpine:3.11 RUN \ -apk add --update npm python ffmpeg && \ -apk add --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \ +apk add --no-cache npm python ffmpeg && \ +apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ atomicparsley # Change directory so that our commands run inside this new directory @@ -21,4 +21,4 @@ RUN npm install EXPOSE 17442 # Run the specified command within the container. -CMD [ "node", "app.js" ] \ No newline at end of file +CMD [ "node", "app.js" ] From d763f88cebdc777f8b02f6fac9d007ba0a1d8456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 May 2020 19:40:35 +0200 Subject: [PATCH 3/4] Remove comments --- backend/Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 1b297eb..5863801 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -5,20 +5,14 @@ apk add --no-cache npm python ffmpeg && \ apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ atomicparsley -# Change directory so that our commands run inside this new directory WORKDIR /app -# Copy dependency definitions COPY ./ /app/ -# Change directory to backend WORKDIR /app -# Install dependencies on backend RUN npm install -# Expose the port the app runs in EXPOSE 17442 -# Run the specified command within the container. CMD [ "node", "app.js" ] From ae76e9db8d8a48a809a057e3c5c5da29c200a3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 May 2020 19:45:19 +0200 Subject: [PATCH 4/4] Install dependencies first, remove duplicated workdir --- backend/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 5863801..b458ac4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -7,12 +7,12 @@ apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testin WORKDIR /app -COPY ./ /app/ - -WORKDIR /app +COPY package.json /app/ RUN npm install +COPY ./ /app/ + EXPOSE 17442 CMD [ "node", "app.js" ]