From 69c11f95a3b6dc93f4d70d311241187181009661 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Fri, 29 Jan 2021 16:47:09 -0500 Subject: [PATCH] update deps, add tini and curl, use COPY not ADD --- result/Dockerfile | 14 +++++++++++++- vote/Dockerfile | 12 +++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/result/Dockerfile b/result/Dockerfile index 4ab503b..ff635a2 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,7 +1,19 @@ FROM node:10-slim +# add curl for healthcheck +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# Add Tini for proper init of signals +ENV TINI_VERSION v0.19.0 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + WORKDIR /app +# have nodemon available for local dev use (file watching) RUN npm install -g nodemon COPY package*.json ./ @@ -16,4 +28,4 @@ ENV PORT 80 EXPOSE 80 -CMD ["node", "server.js"] +CMD ["/tini", "--", "node", "server.js"] diff --git a/vote/Dockerfile b/vote/Dockerfile index ad14ad9..9b04d66 100644 --- a/vote/Dockerfile +++ b/vote/Dockerfile @@ -1,15 +1,21 @@ # Using official python runtime base image -FROM python:2.7-alpine +FROM python:3.9-slim + +# add curl for healthcheck +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + && rm -rf /var/lib/apt/lists/* # Set the application directory WORKDIR /app # Install our requirements.txt -ADD requirements.txt /app/requirements.txt +COPY requirements.txt /app/requirements.txt RUN pip install -r requirements.txt # Copy our code from the current folder to /app inside the container -ADD . /app +COPY . . # Make port 80 available for links and/or publish EXPOSE 80