Merge pull request #71 from steerio/develop
More efficient and flexible Docker builds
This commit is contained in:
commit
58f34d4f4b
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
config.json*
|
||||||
|
*.sqlite
|
21
Dockerfile
21
Dockerfile
@ -1,20 +1,23 @@
|
|||||||
FROM python:3.6.2
|
FROM python:3.6.2
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get -y install build-essential
|
|
||||||
|
|
||||||
# Install TA-lib
|
# Install TA-lib
|
||||||
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
RUN apt-get update && apt-get -y install build-essential && apt-get clean
|
||||||
RUN tar zxvf ta-lib-0.4.0-src.tar.gz
|
RUN curl -L http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | \
|
||||||
RUN cd ta-lib && ./configure && make && make install
|
tar xzvf - && \
|
||||||
|
cd ta-lib && \
|
||||||
|
./configure && make && make install && \
|
||||||
|
cd .. && rm -rf ta-lib
|
||||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||||
|
|
||||||
# Prepare environment
|
# Prepare environment
|
||||||
RUN mkdir /freqtrade
|
RUN mkdir /freqtrade
|
||||||
COPY . /freqtrade/
|
|
||||||
WORKDIR /freqtrade
|
WORKDIR /freqtrade
|
||||||
|
|
||||||
# Install dependencies and execute
|
# Install dependencies
|
||||||
|
COPY requirements.txt /freqtrade/
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Install and execute
|
||||||
|
COPY . /freqtrade/
|
||||||
RUN pip install -e .
|
RUN pip install -e .
|
||||||
CMD ["freqtrade"]
|
CMD ["freqtrade"]
|
||||||
|
47
README.md
47
README.md
@ -47,7 +47,9 @@ Possible values are `running` or `stopped`. (default=`running`)
|
|||||||
If the value is `stopped` the bot has to be started with `/start` first.
|
If the value is `stopped` the bot has to be started with `/start` first.
|
||||||
|
|
||||||
`ask_last_balance` sets the bidding price. Value `0.0` will use `ask` price, `1.0` will
|
`ask_last_balance` sets the bidding price. Value `0.0` will use `ask` price, `1.0` will
|
||||||
use the `last` price and values between those interpolate between ask and last price. Using `ask` price will guarantee quick success in bid, but bot will also end up paying more then would probably have been necessary.
|
use the `last` price and values between those interpolate between ask and last
|
||||||
|
price. Using `ask` price will guarantee quick success in bid, but bot will also
|
||||||
|
end up paying more then would probably have been necessary.
|
||||||
|
|
||||||
The other values should be self-explanatory,
|
The other values should be self-explanatory,
|
||||||
if not feel free to raise a github issue.
|
if not feel free to raise a github issue.
|
||||||
@ -88,12 +90,53 @@ $ BACKTEST=true pytest -s freqtrade/tests/test_backtesting.py
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Docker
|
#### Docker
|
||||||
|
|
||||||
|
Building the image:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd freqtrade
|
$ cd freqtrade
|
||||||
$ docker build -t freqtrade .
|
$ docker build -t freqtrade .
|
||||||
$ docker run --rm -it freqtrade
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For security reasons, your configuration file will not be included in the
|
||||||
|
image, you will need to bind mount it. It is also advised to bind mount
|
||||||
|
a SQLite database file (see second example) to keep it between updates.
|
||||||
|
|
||||||
|
You can run a one-off container that is immediately deleted upon exiting with
|
||||||
|
the following command (config.json must be in the current working directory):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run --rm -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
|
To run a restartable instance in the background (feel free to place your
|
||||||
|
configuration and database files wherever it feels comfortable on your
|
||||||
|
filesystem):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd ~/.freq
|
||||||
|
$ touch tradesv2.sqlite
|
||||||
|
$ docker run -d \
|
||||||
|
--name freqtrade \
|
||||||
|
-v ~/.freq/config.json:/freqtrade/config.json \
|
||||||
|
-v ~/.freq/tradesv2.sqlite:/freqtrade/tradesv2.sqlite \
|
||||||
|
freqtrade
|
||||||
|
```
|
||||||
|
If you are using `dry_run=True` you need to bind `tradesv2.dry_run.sqlite` instead of `tradesv2.sqlite`.
|
||||||
|
|
||||||
|
You can then use the following commands to monitor and manage your container:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker logs freqtrade
|
||||||
|
$ docker logs -f freqtrade
|
||||||
|
$ docker restart freqtrade
|
||||||
|
$ docker stop freqtrade
|
||||||
|
$ docker start freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
|
You do not need to rebuild the image for configuration
|
||||||
|
changes, it will suffice to edit `config.json` and restart the container.
|
||||||
|
|
||||||
#### Contributing
|
#### Contributing
|
||||||
|
|
||||||
Feel like our bot is missing a feature? We welcome your pull requests! Few pointers for contributions:
|
Feel like our bot is missing a feature? We welcome your pull requests! Few pointers for contributions:
|
||||||
|
Loading…
Reference in New Issue
Block a user