-
Notifications
You must be signed in to change notification settings - Fork 1
Setting up HY staging environment
Tapani Honkanen edited this page May 7, 2021
·
2 revisions
- Developers make changes to the main branch on Github.
- Github Actions workflow starts which builds and uploads Docker images to Docker Hub.
- Watchtower container running on staging server listens for new Docker images. It will pull the uploaded images when it detects changes and restarts containers.
- The changes are now visible on the staging server.
- Create a Docker Hub account and create an access token. An access token can be created by logging in to Docker Hub and clicking on your username in the top right corner and selecting Account Settings > Security > New Access Token.
- Provide DOCKERHUB_USERNAME and DOCKERHUB_TOKEN as Github Secrets here. The secrets cannot be read after they have been set so they are safe from your fellow developers!
- DOCKERHUB_USERNAME is your Docker Hub username
- DOCKERHUB_TOKEN is the access token you created
- Ask instructors for permissions to access the staging server.
- Login to the staging server according to the instructions you should have been provided with. This includes running a login script.
- Create a file
docker-compose.yml
to/quantmark
. Example content can be found here but you need to replace the hard-coded username "tapanih" from image names with your Docker Hub username. - Create a file
quantmark.subfolder.conf
to/nginx/config/nginx/proxy-confs
with the following contents:
location /quantmark {
proxy_pass http://quantmark-web:8000;
proxy_set_header Host $host;
}
- All done!
- The staging server is very close to the development environment when it should reflect the production environment.
- The staging server does not serve static files at all. So far this has not been an issue but this might change in the future.
- The staging server runs in a path
/quantmark
so hard-coded links between pages will not work. For example, this is NOT going to work:You should use a view name instead (defined in urls.py) so this is correct:return redirect('/newMolecule/') # WILL NOT WORK ON STAGING!
return redirect('newMolecule') # using view name defined in urls.py
- QuantMark Wiki Homepage
- WebMark Wiki Homepage
- LibMark Wiki Homepage