-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added installation for if ssl certificate to nginx docker image
- Loading branch information
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
FROM nginx:1.15.8 | ||
|
||
# Install Certbot and dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y certbot python3-certbot-nginx && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Remove default Nginx configuration files | ||
RUN rm /etc/nginx/nginx.conf | ||
COPY nginx.conf /etc/nginx/ | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY project.conf /etc/nginx/conf.d/ | ||
|
||
# Copy your custom Nginx configuration | ||
COPY nginx.conf /etc/nginx/ | ||
|
||
# Copy SSL certificate renewal script | ||
COPY renew-certs.sh /renew-certs.sh | ||
RUN chmod +x /renew-certs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Run Certbot to obtain or renew certificates | ||
certbot --nginx --non-interactive --agree-tos -d app.batterymodel.com | ||
|
||
# Reload Nginx configuration to apply new certificates | ||
nginx -s reload |