Skip to content

Commit

Permalink
added an entrypoint to nginx docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Jun 15, 2024
1 parent de0f164 commit 2bf278d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ COPY project.conf /etc/nginx/conf.d/
# Copy SSL certificate renewal script
COPY renew-certs.sh /renew-certs.sh
RUN chmod +x /renew-certs.sh

ENTRYPOINT ["/usr/local/bin/renew-certs.sh"]
8 changes: 1 addition & 7 deletions nginx/renew-certs.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/bin/bash

# Stop existing containers
docker compose down
set -e

# Obtain/renew SSL certificates
certbot certonly --webroot -w /usr/share/nginx/html -d app.batterymodel.com --agree-tos --email [email protected]

# Start containers again
docker compose up -d

# Reload Nginx to apply new certificates
nginx -s reload

0 comments on commit 2bf278d

Please sign in to comment.