Skip to content

Commit 69c11f9

Browse files
committed
update deps, add tini and curl, use COPY not ADD
1 parent 71c87af commit 69c11f9

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

result/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
FROM node:10-slim
22

3+
# add curl for healthcheck
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends \
6+
curl \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# Add Tini for proper init of signals
10+
ENV TINI_VERSION v0.19.0
11+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
12+
RUN chmod +x /tini
13+
314
WORKDIR /app
415

16+
# have nodemon available for local dev use (file watching)
517
RUN npm install -g nodemon
618

719
COPY package*.json ./
@@ -16,4 +28,4 @@ ENV PORT 80
1628

1729
EXPOSE 80
1830

19-
CMD ["node", "server.js"]
31+
CMD ["/tini", "--", "node", "server.js"]

vote/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
# Using official python runtime base image
2-
FROM python:2.7-alpine
2+
FROM python:3.9-slim
3+
4+
# add curl for healthcheck
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends \
7+
curl \
8+
&& rm -rf /var/lib/apt/lists/*
39

410
# Set the application directory
511
WORKDIR /app
612

713
# Install our requirements.txt
8-
ADD requirements.txt /app/requirements.txt
14+
COPY requirements.txt /app/requirements.txt
915
RUN pip install -r requirements.txt
1016

1117
# Copy our code from the current folder to /app inside the container
12-
ADD . /app
18+
COPY . .
1319

1420
# Make port 80 available for links and/or publish
1521
EXPOSE 80

0 commit comments

Comments
 (0)