From f29204265c7ba681f9998916481ebbf2f542e652 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Mon, 11 Dec 2017 13:56:54 +0100 Subject: [PATCH] Update Dockerfile, fix for #96 --- docker/Dockerfile | 7 +++---- docker/fetch.sh | 11 ----------- docker/run.sh | 12 ++++++------ docker/update_weboob.sh | 11 +++++++++++ 4 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 docker/fetch.sh create mode 100644 docker/update_weboob.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index a50ddb0..9bed1e4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,10 +39,9 @@ RUN mkdir -p /home/user/.local/share/flatisfy COPY ./run.sh /home/user/run.sh RUN chmod +x /home/user/run.sh -COPY ./fetch.sh /home/user/fetch.sh -RUN chmod +x /home/user/fetch.sh +COPY ./update_weboob.sh /home/user/update_weboob.sh +RUN chmod +x /home/user/update_weboob.sh # Run server. -USER user -CMD /home/user/run.sh EXPOSE 8080 +CMD /home/user/run.sh diff --git a/docker/fetch.sh b/docker/fetch.sh deleted file mode 100644 index 8ba702a..0000000 --- a/docker/fetch.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -echo "Updating Weboob..." -cd /home/user/weboob -git pull -pip install --upgrade . - -echo "Fetching housing posts..." -cd /home/user/app -python -m flatisfy import -v --config /flatisfy/config.json diff --git a/docker/run.sh b/docker/run.sh index 5a1911c..d4b0caf 100644 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,16 +1,16 @@ #!/bin/bash set -e -echo "Setting fake values for git config..." -git config --global user.email flatisfy@example.com -git config --global user.name "Flatisfy Root" +echo "Update Weboob..." +/home/user/update_weboob.sh echo "Building data for Flatisfy..." cd /home/user/app -python -m flatisfy build-data -v --config /flatisfy/config.json +su user -c "python -m flatisfy build-data -v --config /flatisfy/config.json" echo "Fetching new housing posts..." -/home/user/fetch.sh +cd /home/user/app +su user -c "python -m flatisfy import -v --config /flatisfy/config.json" echo "Starting web UI..." -python -m flatisfy serve -v --config /flatisfy/config.json +exec su user -c "python -m flatisfy serve -v --config /flatisfy/config.json" diff --git a/docker/update_weboob.sh b/docker/update_weboob.sh new file mode 100644 index 0000000..135842b --- /dev/null +++ b/docker/update_weboob.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +echo "Setting fake values for git config..." +git config --global user.email flatisfy@example.com +git config --global user.name "Flatisfy Root" + +echo "Updating Weboob..." +cd /home/user/weboob +git pull +pip install --upgrade .