-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 680 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (24 loc) · 680 Bytes
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 node:10-alpine
MAINTAINER Aldo Bernardes Maciel
# build view
WORKDIR /app/view
COPY *.json /app/view/
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python
RUN npm install --quiet node-gyp -g
RUN npm install
COPY view/src /app/view/src
COPY view/public /app/view/public
RUN npm run build
# build server
WORKDIR /app
COPY *.json /app/
COPY src /app/src
RUN npm run build
# run
RUN echo 'set -e' >> /boot.sh
# daemon for cron jobs
RUN echo 'crond' >> /boot.sh
#RUN echo 'npm install --production' >> /boot.sh
# npm start, make sure to have a start attribute in "scripts" in package.json
RUN echo 'sleep 5' >> /boot.sh
CMD sh /boot.sh && npm run start