Update Dockerfile, fix for #96

This commit is contained in:
Lucas Verney 2017-12-11 13:56:54 +01:00
parent e5d5c8373c
commit f29204265c
4 changed files with 20 additions and 21 deletions

View File

@ -39,10 +39,9 @@ RUN mkdir -p /home/user/.local/share/flatisfy
COPY ./run.sh /home/user/run.sh COPY ./run.sh /home/user/run.sh
RUN chmod +x /home/user/run.sh RUN chmod +x /home/user/run.sh
COPY ./fetch.sh /home/user/fetch.sh COPY ./update_weboob.sh /home/user/update_weboob.sh
RUN chmod +x /home/user/fetch.sh RUN chmod +x /home/user/update_weboob.sh
# Run server. # Run server.
USER user
CMD /home/user/run.sh
EXPOSE 8080 EXPOSE 8080
CMD /home/user/run.sh

View File

@ -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

View File

@ -1,16 +1,16 @@
#!/bin/bash #!/bin/bash
set -e set -e
echo "Setting fake values for git config..." echo "Update Weboob..."
git config --global user.email flatisfy@example.com /home/user/update_weboob.sh
git config --global user.name "Flatisfy Root"
echo "Building data for Flatisfy..." echo "Building data for Flatisfy..."
cd /home/user/app 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..." 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..." 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"

11
docker/update_weboob.sh Normal file
View File

@ -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 .