mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-07-10 17:09:28 +00:00
update deps, add tini and curl, use COPY not ADD
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user