This directory contains scripts and docker configs for deploying onedata.org homepage. It is based on the nginx-certbot boilerplate by Philipp Schmieder: https://github.com/wmnnd/nginx-certbot
Prepare a host with the following:
- git
- docker
- docker-compose
- python + pyyaml
- hostname set to onedata.org
- static DNS A records pointing to the host's IP for domains onedata.org and www.onedata.org
Run ./test-preview.sh
, the homepage should show up automatically in your
browser on http://localhost:8000
(if not, visit the page manually) -
this runs the homepage static docker with a web server inside.
- Run
./update-homepage.py deploy
to deploy static homepage files according tohomepage-docker-image.cfg
- Run
./init-letsencrypt.sh
, you might want to enable staging mode before (see the beginning of the script) - Verify if the certificates are OK and homepage is served on onedata.org
- Run
docker-compose up -d
The maintenance is quite easy - dockers are configured to restart automatically, there is a certbot container running that tries to renew the certificates every 12 hours, plus a periodic task that reloads the nginx server to pick up the new certs.
In case the dockers are killed somehow, just do docker-compose up -d
.
The static files of homepage can be updated without stopping the containers -
they use a mount point from host. Use the ./update-homepage.py
script
(consult the code or help
for more). General procedure looks like the following:
-
Run
./update-homepage.py image docker.onedata.org/homepage:ID-67e61b7749
in the repository (replace with desired ID), this will change the image inhomepage-docker-image.cfg
. -
Commit and push the changes
-
Pull the changes on the onedata.org host
-
Run
./update-homepage.py deploy
on the onedata.org host -
Done, the nginx will be serving the new homepage from now on.