Rework Docker image and add some doc.

Thanks @bnjbvr for the contribution!

This closes #15.
This commit is contained in:
Lucas Verney 2017-06-21 15:09:49 +02:00
parent 4c558ef182
commit a9ac5484e0
5 changed files with 45 additions and 4 deletions

View File

@ -33,7 +33,8 @@ This code is not restricted to handling flats only!
## Getting started
See the [getting started guide](doc/0.getting_started.md).
See the [getting started guide](doc/0.getting_started.md). If you want to give
it a try quickly, you can have a look at the [Docker image](doc/2.docker.md).
## Documentation

View File

@ -12,6 +12,8 @@ yet been merged.
## TL;DR
An alternative method is available using Docker. See [2.docker.md](2.docker.md).
1. Clone the repository.
2. Install required Python modules: `pip install -r requirements.txt`.
3. Init a configuration file: `python -m flatisfy init-config > config.json`.

38
doc/2.docker.md Normal file
View File

@ -0,0 +1,38 @@
Testing Flatisfy using Docker
=============================
A basic `Dockerfile` is available for rapid testing. It is still really hacky
and should not be used in production.
1. First, build the docker image:
```
cd docker
docker build -t bnjbvr/flatisfy .
```
2. Then, create some folder to store your Flatisfy data in a permanent way (it
will be mount as a Docker volume in next steps), and initialize an empty
config:
```
mkdir flatisfy
cd flatisfy
FLATISFY_VOLUME=$(pwd)
docker run -P -v $FLATISFY_VOLUME:/flatisfy -p 8080:8080 bnjbvr/flatisfy sh -c "cd /home/user/app && python -m flatisfy init-config > /flatisfy/config.json"
```
3. Then, edit the generated `config.json` file according to your needs. See
[0.getting_started.md](0.getting_started.md) for more infos on the
configuration file format.
4. Finally, run the docker image to fetch flats and serve the web UI:
```
docker run -P -v $FLATISFY_VOLUME:/flatisfy -p 8080:8080 bnjbvr/flatisfy
```
Your Flatisfy instance is now available at `localhost:8080`!

View File

@ -31,7 +31,7 @@ VOLUME /flatisfy
# Install Flatisfy.
RUN cd /home/user \
&& git clone https://git.phyks.me/bnjbvr/flatisfy/ ./app \
&& git clone https://git.phyks.me/Phyks/flatisfy/ ./app \
&& cd ./app \
&& pip install -r requirements.txt \
&& npm install \

View File

@ -15,6 +15,6 @@ do
cd /home/user/app
python -m flatisfy import -v --config /flatisfy/config.json
echo "Done, sleeping for 5 minutes."
sleep 300
echo "Done, sleeping for 30 minutes."
sleep 1800
done