|
@@ -0,0 +1,26 @@
|
|
1
|
+FROM node:10-alpine
|
|
2
|
+
|
|
3
|
+WORKDIR /opt/app
|
|
4
|
+
|
|
5
|
+ENV PORT=80
|
|
6
|
+
|
|
7
|
+RUN touch /usr/bin/start.sh # this is the script which will run on start
|
|
8
|
+
|
|
9
|
+# if you need a build script, uncomment the line below
|
|
10
|
+# RUN echo 'sh mybuild.sh' >> /usr/bin/start.sh
|
|
11
|
+
|
|
12
|
+# if you need redis, uncomment the lines below
|
|
13
|
+# RUN apk --update add redis
|
|
14
|
+# RUN echo 'redis-server &' >> /usr/bin/start.sh
|
|
15
|
+
|
|
16
|
+# daemon for cron jobs
|
|
17
|
+RUN echo 'echo will install crond...' >> /usr/bin/start.sh
|
|
18
|
+RUN echo 'crond' >> /usr/bin/start.sh
|
|
19
|
+
|
|
20
|
+# Basic npm start verification
|
|
21
|
+RUN echo 'nb=`cat package.json | grep start | wc -l` && if test "$nb" = "0" ; then echo "*** Boot issue: No start command found in your package.json in the scripts. See https://docs.npmjs.com/cli/start" ; exit 1 ; fi' >> /usr/bin/start.sh
|
|
22
|
+
|
|
23
|
+RUN echo 'npm install --production' >> /usr/bin/start.sh
|
|
24
|
+
|
|
25
|
+# npm start, make sure to have a start attribute in "scripts" in package.json
|
|
26
|
+RUN echo 'npm start' >> /usr/bin/start.sh
|