mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-05-11 03:56:43 +00:00
28 lines
478 B
Docker
28 lines
478 B
Docker
FROM node:18-slim
|
|
|
|
# add curl for healthcheck
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
curl \
|
|
tini \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# have nodemon available for local dev use (file watching)
|
|
RUN npm install -g nodemon
|
|
|
|
COPY package*.json ./
|
|
|
|
RUN npm ci \
|
|
&& npm cache clean --force \
|
|
&& mv /app/node_modules /node_modules
|
|
|
|
COPY . .
|
|
|
|
ENV PORT 80
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
CMD ["node", "server.js"]
|