Skip to content

Commit

Permalink
added certibot installation to nginx docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Jun 16, 2024
1 parent 20e690f commit a64bbd1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
FROM nginx:latest

# 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/*

# Create necessary directories for Let's Encrypt challenge
RUN mkdir -p /usr/share/nginx/html/.well-known/acme-challenge && \
chown -R www-data:www-data /usr/share/nginx/html/.well-known && \
chmod -R 755 /usr/share/nginx/html/.well-known

# Remove default Nginx configuration files
RUN rm /etc/nginx/nginx.conf
RUN rm /etc/nginx/conf.d/default.conf
Expand Down

0 comments on commit a64bbd1

Please sign in to comment.