Skip to content

Commit

Permalink
Add documentation for certificate renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni000 committed Sep 25, 2024
1 parent 69c230e commit ea519a3
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/deployment-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,32 @@ The application is now deployed and the website should be accessible via http (`
release and the containers restarted accordingly via [Watchtower](https://github.com/containrrr/watchtower).

Note that this also means that it is currently not possible to have multiple Frontend instances deployed that talk to different backend instances.
To achieve that, the Frontend instances each need to be manually built and deployed with the correct environment variables.
To achieve that, the Frontend instances each need to be manually built and deployed with the correct environment variables.

## Renewing Certificates

1. ssh into the server, e.g. `ssh [email protected] -i .ssh/bp_server`
2. free up port 80 by stopping website: `sudo docker-compose -f docker-compose.yml down`
3. run certbot: ` sudo certbot certonly --nginx -d klinik-dps.de -d www.klinik-dps.de`
4. kill nginx: `sudo pkill nginx` (yeah it's in a weird state at this point and needs to be killed that way, don't ask me why)
5. restart website: `sudo docker-compose -f docker-compose.yml up`

If you run into problems:

1. Check if port 80 is in use by something else: `netstat -antp`
2. Allow http in firewall if necessary: `firewall-cmd --permanent --add-service=http` and `firewall-cmd --reload`
3. Make sure nginx config is fine (should be located in `/etc/nginx/conf.d`):

```
server {
listen 80;
server_name klinik-dps.de www.klinik-dps.de;
root /usr/share/nginx/html; # Base directory for web content
index index.html;
location /.well-known/ {
try_files $uri $uri/ =404;
}
}
```

0 comments on commit ea519a3

Please sign in to comment.