diff --git a/Dockerfile b/Dockerfile index 407c4d0..8c1115c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,7 +72,8 @@ RUN touch /var/log/floscout/floscout.out.log RUN mkdir /data WORKDIR / -COPY mongoose-server +RUN mkdir mongoose-server +COPY mongoose-server/ /mongoose-server COPY run.sh . RUN chmod +x run.sh ENTRYPOINT ["sh","/run.sh"] diff --git a/mongoose-server/examples/http-server/main.c b/mongoose-server/examples/http-server/main.c index fa2c48d..e93be16 100644 --- a/mongoose-server/examples/http-server/main.c +++ b/mongoose-server/examples/http-server/main.c @@ -6,7 +6,7 @@ static const char *s_debug_level = "2"; static const char *s_root_dir = "."; -static const char *s_listening_address = "http://0.0.0.0:6012"; +static const char *s_listening_address = "http://0.0.0.0:6200"; static const char *s_enable_hexdump = "no"; static const char *s_ssi_pattern = "#.html"; diff --git a/run.sh b/run.sh index f8ab192..3e7376a 100755 --- a/run.sh +++ b/run.sh @@ -1,8 +1,10 @@ #!/bin/bash -cd /etc/supervisor/conf.d/ -sed -i "s|command=hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app|command=hypercorn -w 1 -b $FLOAPIURL wsgi:app|" /etc/supervisor/conf.d/ftt-ranchimallflo.conf -sed -i "s|window.tokenapiUrl = 'https://ranchimallflo.duckdns.org'|window.tokenapiUrl = '$FLOAPIURL'|" /floscout/index.html +# prepare binary +cd /mongoose-server/examples/http-server +make +chmod +x example +cp example /floscout if [ ! -z "$FLOSCOUT_BOOTSTRAP" ] && [ "$(cat /data/floscout-url.txt)" != "$FLOSCOUT_BOOTSTRAP" ] then @@ -23,12 +25,11 @@ then ls /data fi -# prepare binary -cd /mongoose-server/examples/http-server -make -chmod +x example -cp example /floscout +cd /etc/supervisor/conf.d/ +sed -i "s|command=hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app|command=hypercorn -w 1 -b $FLOAPIURL wsgi:app|" /etc/supervisor/conf.d/ftt-ranchimallflo.conf +sed -i "s|window.tokenapiUrl = 'https://ranchimallflo.duckdns.org'|window.tokenapiUrl = '$FLOAPIURL'|" /floscout/index.html echo "running..." supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf -./floscout/example +cd /floscout +./example