From 28b8605b8155e053fa651aef358e9a828c9ac1fd Mon Sep 17 00:00:00 2001 From: Divyansh Bhardwaj <87605149+Dbhardwaj99@users.noreply.github.com> Date: Sun, 1 May 2022 20:20:43 +0530 Subject: [PATCH] added volumes and scripts to automate it --- Dockerfile | 13 ++++++++----- README.md | 17 +++++++++++++++-- run.sh | 5 +++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8713c0..d84d555 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,11 +69,11 @@ RUN mv example ~/floscout WORKDIR ../ WORKDIR ../ -# setup of mongoose server -# RUN git clone https://github.com/cesanta/mongoose.git -# WORKDIR mongoose -# RUN simplest_web_server.c -# WORKDIR ../ + setup of mongoose server + RUN git clone https://github.com/cesanta/mongoose.git + WORKDIR mongoose + RUN simplest_web_server.c + WORKDIR ../ # Supervisor configurations ## Flo token tracking configuration @@ -88,4 +88,7 @@ RUN mkdir /var/log/ranchimallflo-api/ RUN touch /var/log/ranchimallflo-api/ranchimallflo-api.err.log RUN touch /var/log/ranchimallflo-api/ranchimallflo-api.out.log +COPY run.sh . +RUN chmod +x run.sh +CMD ["/etc/supervisor/conf.d/run.sh"] # RUN supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf diff --git a/README.md b/README.md index e07084c..dddb9b4 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,21 @@ RanchiMall wants to made things easy for you by packing all the three systems to ## How do I use this? -Clone the repository and then run +Clone the repository and then crete a docker volume + +``` +docker volume inspect ranchimall-flo-volume +``` + +Build the docker image by the following command ``` sudo docker build . -``` \ No newline at end of file +``` + +Run the docker container with exposing all the port and mounting the volume + +``` +docker run -d -p 5009:5009 6200:6200 -v ranchimall-flo-volume 147fcf811419 +``` + diff --git a/run.sh b/run.sh index 40c0213..1d4485d 100644 --- a/run.sh +++ b/run.sh @@ -1,4 +1,5 @@ #!/bin/bash +cd /etc/supervisor/conf.d/ -exec python3 /ftt-docker/tracktokens-smartcontracts.py & -exec python3 /ranchimallflo-api/hypercorn -w 1 -b 0.0.0.0:5009 wsgi:app \ No newline at end of file +echo "running..." +supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf \ No newline at end of file