Clone the repo:
git clone https://github.com/Faithful1/bitwall.git
To develop locally, create a new virtual env in the flask
directory & run the app:
cd app
python -m venv env
source env/bin/activate
pip install -r requirements.txt
export FLASK_APP=run.py
export FLASK_ENV=development
flask run
Go to - http://127.0.0.1:5000
Ensure these are installed before going further:
- docker@^18.05.0-ce
- docker-compose@^1.21.2
- navigate to /etc/hosts and edit the host file mapping a virtual host domain to your localhost in my case
127.0.0.1 bitwalla.lh
- navigate into the root folder of our cloned application
- run
chmod +x init-ssl.sh
- run
sudo ./init-ssl.sh
to generate our self-signed certificates - create a .env file in your root folder, check through the "envsample" file here on this repo and copy the contents into your .env file giving your app a name of course and your server domain name
- edit the nginx config file
nginx/nginx.conf
changing the server_name to your own domain nameserver_name YOUR_DOMAIN_NAME
- run
docker-compose up -d
You can begin editing code on your host machine, changes will be detected and all relevant processes restarted or live-reloaded inside their containers.
docker-compose ps
(print status) to see all running containersdocker-compose logs service-name(e.g api or mongo)
(attaches to logs of one or more services)
Go to - localhost or http://127.0.0.1/ or (virtual_host domain) on your browser and see the app redirect to https
nginx
logs anduwsgi
logs will be logged to/var/log/nginx
and/var/log/uwsgi
respectively. This can be changed by changing thevolume
mounts in thedocker-compose.yml
.
Alternatively, delete the volumes
to have Docker log to Stdout
.
- consider using proper certificates authorities like letsencrypt or cloudflare for a production environment