-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (22 loc) · 791 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.8-slim-buster@sha256:2ce8031b678a8de21815a760313707f145f69ffc80f8d411b2d5f198f47608bf as base
RUN apt-get update
RUN apt-get install curl nano -y
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
RUN apt-get install nodejs -y
RUN useradd -ms /bin/bash node
WORKDIR /home/node
EXPOSE 4080
HEALTHCHECK --interval=15s --timeout=10s --retries=2 CMD curl -f http://localhost:4080/health || exit 1
COPY --chown=node:node requirements.txt ./
RUN pip3 install -r requirements.txt
COPY --chown=node:node package*.json ./
FROM base as production
RUN npm ci --only=production
COPY --chown=node:node ./ ./
USER node
CMD ["node", "src/server.js"]
FROM base as development
RUN npm i -g nodemon && npm ci
COPY --chown=node:node ./ ./
USER node
CMD ["nodemon", "src/server.js"]