Skip to content

Commit

Permalink
certbot domain added to .nginx file
Browse files Browse the repository at this point in the history
  • Loading branch information
budescode committed Feb 6, 2024
1 parent ce76162 commit c435da8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
FROM nginx:latest

COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy the .env file into the container
COPY ../.env /etc/nginx/conf.d/.env

# Set environment variable based on the values in the .env file
RUN export CERTBOT_DOMAIN=$(cat /etc/nginx/conf.d/.env | grep CERTBOT_DOMAIN | cut -d '=' -f 2)

# Replace the placeholder in the nginx.conf file with the actual domain name
RUN sed -i "s/\$CERTBOT_DOMAIN/$CERTBOT_DOMAIN/g" /etc/nginx/conf.d/default.conf

EXPOSE 80

Expand Down
6 changes: 3 additions & 3 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ server {
server {
listen 443 ssl http2;
# use the certificates
ssl_certificate /etc/letsencrypt/live/$CERTBOT_DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$CERTBOT_DOMAIN/privkey.pem;
server_name $CERTBOT_DOMAIN www.$CERTBOT_DOMAIN;
ssl_certificate /etc/letsencrypt/live/scorezone.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/scorezone.xyz/privkey.pem;
server_name scorezone.xyz www.scorezone.xyz;


location / {
Expand Down

0 comments on commit c435da8

Please sign in to comment.