|Mark Veidemanis e10c6f5c46||4 weeks ago|
|app||2 months ago|
|core||4 weeks ago|
|docker||1 month ago|
|.gitignore||2 months ago|
|.pre-commit-config.yaml||8 months ago|
|Dockerfile||2 months ago|
|Makefile-dev||1 month ago|
|Makefile-prod||2 months ago|
|README.md||12 months ago|
|docker-compose.dev.yml||1 month ago|
|docker-compose.yml||2 months ago|
|manage.py||12 months ago|
|requirements.txt||7 months ago|
Cryptocurrency signal aggregator and trade executor.
Setting up the environment
Create the virtual environment, enable it, and install the dependencies.
$ python3 -m venv env $ source env/bin/activate (env) $ pip install -r docker/prod/requirements.prod.txt
You'll need to copy the
app/local_settings.example.py file to
app/local_settings.py. The project won't start otherwise.
$ cp app/local_settings.example.py app/local_settings.py
The stack.env file referenced is a Portainer special. This is where Portainer would put a file containing all the environment variables set up in its UI.
To run it manually, you will need to copy
stack.env in the project root.
Running database migrations
Now we need to run the database migrations in order to get a working database.
(env) $ python manage.py migrate
Note that these are automatically run by a step in the compose file in production. You won't need to do that manually.
Creating a superuser
In order to access Django admin, we need a superuser.
(env) $ python manage.py createsuperuser Username: t2 Email address: email@example.com Password: Password (again): Superuser created successfully.
The Docker Compose file is located in
There is a shortcut to run it:
To stop the containers, run
This setup may be different from what you've seen before.
There is a Uvicorn worker in the
app container listening on
/var/run/socks/app.sock. This is the bit that runs the actual code.
Nginx runs in the
nginx container and proxies requests to Uvicorn thanks to a mounted and shared directory. No TCP required.
There's a few commands running before start to ensure Django works correctly.
migration container step runs the migrations so you don't need to remember to do it.
collectstatic container step collects all static files from plugins and puts them in the
core/static folder. This folder is served straight from Nginx without going through Uvicorn.