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 9e773c2 commit ff7d4f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ FROM nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy the .env file into the container
COPY /code/.env /etc/nginx/conf.d/.env
# Set environment variables based on the values in the .env file
ENV SERVER_NAME=$(cat /etc/nginx/.env | grep CERTBOT_DOMAIN | cut -d '=' -f 2)

# 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

0 comments on commit ff7d4f3

Please sign in to comment.