2017-12-05 14:56:08 +01:00
|
|
|
Installing Flatisfy using Docker
|
|
|
|
================================
|
2017-06-21 15:09:49 +02:00
|
|
|
|
|
|
|
A basic `Dockerfile` is available for rapid testing. It is still really hacky
|
|
|
|
and should not be used in production.
|
|
|
|
|
|
|
|
|
2017-11-26 21:53:59 +01:00
|
|
|
1\. First, build the docker image:
|
2017-06-21 15:09:49 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
cd docker
|
2017-11-26 21:53:59 +01:00
|
|
|
docker build -t phyks/flatisfy .
|
2017-06-21 15:09:49 +02:00
|
|
|
```
|
|
|
|
|
2017-11-26 21:53:59 +01:00
|
|
|
2\. Then, create some folder to store your Flatisfy data in a permanent way (it
|
2017-06-21 15:09:49 +02:00
|
|
|
will be mount as a Docker volume in next steps), and initialize an empty
|
|
|
|
config:
|
|
|
|
|
|
|
|
```
|
|
|
|
mkdir flatisfy
|
|
|
|
cd flatisfy
|
|
|
|
FLATISFY_VOLUME=$(pwd)
|
2018-08-22 13:14:00 +02:00
|
|
|
docker run --rm -it -e LOCAL_USER_ID=`id -u` -v $FLATISFY_VOLUME:/flatisfy phyks/flatisfy sh -c "cd /home/user/app && python -m flatisfy init-config > /flatisfy/config.json"
|
2017-06-21 15:09:49 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2017-11-27 12:23:08 +01:00
|
|
|
3\. Then, edit the generated `$FLATISFY_VOLUME/config.json` file according to your needs. See
|
2017-06-21 15:09:49 +02:00
|
|
|
[0.getting_started.md](0.getting_started.md) for more infos on the
|
2017-11-27 12:23:08 +01:00
|
|
|
configuration file format. You will have to define your constraints (at
|
|
|
|
least postal codes, house type and type of post), set `data_directory` to
|
|
|
|
`/flatisfy` and set `host` to `0.0.0.0` to make the web UI accessible from
|
|
|
|
outside the Docker container. The rest is up to you.
|
2017-06-21 15:09:49 +02:00
|
|
|
|
|
|
|
|
2017-11-26 21:53:59 +01:00
|
|
|
4\. Finally, run the docker image to fetch flats and serve the web UI:
|
2017-06-21 15:09:49 +02:00
|
|
|
|
|
|
|
```
|
2017-12-30 19:57:14 +01:00
|
|
|
docker run -it -e LOCAL_USER_ID=`id -u` -v $FLATISFY_VOLUME:/flatisfy -p 8080:8080 phyks/flatisfy
|
2017-06-21 15:09:49 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Your Flatisfy instance is now available at `localhost:8080`!
|
2017-11-27 12:23:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
To fetch new housing posts, you should manually call
|
|
|
|
|
|
|
|
```
|
2018-08-22 13:14:00 +02:00
|
|
|
docker run --rm -it -e LOCAL_USER_ID=`id -u` -v $FLATISFY_VOLUME:/flatisfy phyks/flatisfy /home/user/fetch.sh
|
2017-11-27 12:23:08 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
This can be done easily in a crontask on your host system, to run it typically
|
|
|
|
every night.
|