|
@@ -7,23 +7,7 @@ VOLUME /opt/app/server-data
|
7
|
7
|
|
8
|
8
|
RUN touch /usr/bin/start.sh # this is the script which will run on start
|
9
|
9
|
|
10
|
|
-# if you need a build script, uncomment the line below
|
11
|
|
-# RUN echo 'sh mybuild.sh' >> /usr/bin/start.sh
|
12
|
|
-
|
13
|
|
-# if you need redis, uncomment the lines below
|
14
|
|
-# RUN apk --update add redis
|
15
|
|
-# RUN echo 'redis-server &' >> /usr/bin/start.sh
|
16
|
|
-
|
17
|
|
-# daemon for cron jobs
|
18
|
|
-# RUN echo 'echo will install crond...' >> /usr/bin/start.sh
|
19
|
|
-# RUN echo 'crond' >> /usr/bin/start.sh
|
20
|
|
-
|
21
|
|
-# Basic npm start verification
|
22
|
|
-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
|
23
|
|
-
|
24
|
10
|
RUN echo 'npm install --production' >> /usr/bin/start.sh
|
25
|
|
-
|
26
|
|
-# npm start, make sure to have a start attribute in "scripts" in package.json
|
27
|
|
-RUN echo 'npm start' >> /usr/bin/start.sh
|
|
11
|
+RUN echo 'npx forever --minUptime 7000 --spinSleepTime 2000 -o out.log -e err.log ./server/server.js' >> /usr/bin/start.sh
|
28
|
12
|
|
29
|
13
|
CMD ["/bin/sh","/usr/bin/start.sh"]
|