Standalone starlette app which receives a new site build request, and builds the site. (ref https://github.com/Subscribie/module-builder/issues/7)
Responsible for building new subscribie sites.
virtualenv -p python3 venv
. venv/bin/activate
pip install -r requirements.txt
For running locally in development: ./run.sh
Clone subscribie to a folder on a deployment server. Set SUBSCRIBIE_REPO_DIRECTORY
to the repo folder.
Create a virtualenv
folder and set to PYTHON_VENV_DIRECTORY
, pip install the requirements.txt
Go into the subscribie shared repo, and create a database schema using flask db upgrade
inside PYTHON_VENV_DIRECTORY
.env.example
to .env
and set SQLALCHEMY_DATABASE_URI
to SUBSCRIBIE_REPO_DIRECTORY
root (the empty schema is copied to new sites to speed up new site deploymentsBack into this repo (deployer) Set PYTHON_PATH_INJECT
to the same value as SUBSCRIBIE_REPO_DIRECTORY
How to run:
uwsgi --ini config.ini # add -d to demonize
Ensure that dir /tmp/sockets/ exists (for the vassal sites .ini files)
Then chmod
# mysite_nginx.conf
#
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name *.app1 example.com ~^.*.example.com app2 site1.local site2.local; # substitute your machine's IP address or FQDN
root /home/chris/Documents/python/uwsgi/vassals/;
charset utf-8;
client_max_body_size 75M;
# max upload size
location / {
proxy_pass http://127.0.0.1:8002/;
}
}
(Using ip rather than sockets)
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName example.com
ServerAlias *.example.com
ProxyPass / http://127.0.0.1:8002/
</VirtualHost>
curl http://127.0.0.1:5001/ -d '{"company": {"name": "My Test Shop"}, "users": ["sam@example.com"], "password": "123", "plans": [{"title": "Hair Gel", "description": "Luxuary hair gel", "interval_amount": 100, "interval_unit": "monthly", "sell_price": 1500}]}'