Skip to content

Commit

Permalink
polishing Docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mk committed Apr 4, 2016
1 parent a2b67dc commit 8569d65
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ db.sqlite3
pypolo/local_settings.py
data.json
db.sqlite3-journal
docker/env
docker-compose.yml
static/*
.DS_Store
*.pyc
static/*
*.log
*.swp
File renamed without changes.
2 changes: 2 additions & 0 deletions docker/env → docker/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ POSTGRES_USER=trader
POSTGRES_PASSWORD=trader
POSTGRES_DB=trader

POLONIEX_API_KEY=
POLONIEX_API_SECRET=
14 changes: 11 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,16 @@ See the next document, [How to trade with pytrader](https://github.com/owocki/py

Work with docker 1.10.3 and docker-compose 1.6.2

1. Export your POLONIEX_API_KEY and POLONIEX_API_SECRET env vars.
2. Build (compiling stuff for scipy and numpy takes time): `docker-compose build` or pull the images from Docker Hub: `docker-compose pull`
3. `cd pypolo; cp local_settings.py.example local_settings.py`
- initalize your environment:

```
cp docker-compsoe.yml.example docker-compose.yml
cp docker/env.example docker/env
cp pypolo/local_settings.py.example pypolo/local_settings.py`
```

1. Add your POLONIEX_API_KEY and POLONIEX_API_SECRET to docker/env (its gitignored, dont worry)
2. Build Docker image (compiling stuff for scipy and numpy takes time): `docker-compose build` or pull the images from Docker Hub: `docker-compose pull`
4. Run the containers: `docker-compose up`
5. Get shell: `docker exec -it pytrader_web_1 /bin/bash`
6. Place sql seed in this repo dir as `prices.psql`
Expand All @@ -241,6 +248,7 @@ cd /root/pytrader
export PGPASSWORD=$POSTGRES_PASSWORD
psql -h db -U trader trader < prices.psql
```
wait for the psql load to end

8. restart setup: (in the host): `docker-compose kill && docker-compose up -d`
9. Visit http://localhost:8000/admin and log in as `trader:trader`
Expand Down

0 comments on commit 8569d65

Please sign in to comment.