retold-harness 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile_LUXURYCode
CHANGED
|
@@ -79,14 +79,12 @@ RUN echo "...installing node version manager..."
|
|
|
79
79
|
# Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in. This is not great.
|
|
80
80
|
RUN touch ~/.bashrc && chmod +x ~/.bashrc
|
|
81
81
|
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
|
82
|
+
RUN chmod +x ~/.nvm/nvm.sh
|
|
82
83
|
|
|
83
84
|
RUN echo "...installing node version 14 as the default..."
|
|
84
85
|
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
|
|
85
86
|
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
|
|
86
87
|
|
|
87
|
-
# Install PM2
|
|
88
|
-
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && npm install pm2 -g
|
|
89
|
-
|
|
90
88
|
WORKDIR /home/coder/retold-harness
|
|
91
89
|
|
|
92
90
|
ENTRYPOINT ["/usr/bin/MySQL-Laden-Entry.sh"]
|
|
@@ -2,15 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
trap 'kill -TERM $PID' TERM INT
|
|
4
4
|
|
|
5
|
+
# Start the Visual Studio Code Server
|
|
5
6
|
/usr/bin/entrypoint.sh --bind-addr "0.0.0.0:8080" . &
|
|
6
7
|
|
|
7
8
|
PID=$!
|
|
8
9
|
|
|
9
10
|
sleep 2
|
|
10
11
|
|
|
12
|
+
# Start the MariaDB Server
|
|
11
13
|
sudo service mariadb restart
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
# Wait a bit over a minute for the server to come up
|
|
16
|
+
LOOP_LIMIT=30
|
|
17
|
+
for (( i=0 ; ; i++ )); do
|
|
18
|
+
if [ ${i} -eq ${LOOP_LIMIT} ]; then
|
|
19
|
+
echo "Time out. Error log is shown as below:"
|
|
20
|
+
tail -n 100 ${LOG}
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
echo "=> Waiting for confirmation of MySQL service startup; attempt ${i} of ${LOOP_LIMIT} ..."
|
|
24
|
+
sleep 2
|
|
25
|
+
mysql -u root -p"123456789" -e "status" > /dev/null 2>&1 && break
|
|
26
|
+
done
|
|
27
|
+
|
|
28
|
+
echo "=> MySQL service startup finished. <="
|
|
29
|
+
|
|
30
|
+
# Install the latest pm2 process manager
|
|
31
|
+
# This is *quite complex* because we want to run as the synthesized user pulled in to match the user in our environment
|
|
32
|
+
# FOR POSTERITY: Running bash in interactive mode, trying to manually source the bashrc, etc. all failed due to
|
|
33
|
+
# the complex way docker and the base image set the user (we have an explicit user ID). This method
|
|
34
|
+
# works but is ugly as heck.
|
|
35
|
+
export HOME=/home/coder
|
|
36
|
+
bash -i <(echo "npm install pm2 -g")
|
|
37
|
+
# Now run the harness API within the pm2 process manager
|
|
38
|
+
# Twiddling for posterity (these didn't work)
|
|
39
|
+
#bash -c "pm2 start /home/coder/retold-harness/source/Retold-Harness.js"
|
|
40
|
+
#bash --init-file <(echo "source /home/coder/.bashrc && pm2 start /home/coder/retold-harness/source/Retold-Harness.js")
|
|
41
|
+
bash -i <(echo "pm2 start /home/coder/retold-harness/source/Retold-Harness.js")
|
|
14
42
|
|
|
15
43
|
wait $PID
|
|
16
44
|
trap - TERM INT
|
package/package.json
CHANGED