Add Certbot Service with Dockerfile and Adjust Nginx Config Path

- Added `services/certbot/Dockerfile` for Certbot configuration with Ubuntu 22.04.
- Set up volumes, dependencies, and command for automatic certificate renewal.
- Corrected Nginx configuration file path in `services/nginx/Dockerfile`.
This commit is contained in:
Jeppe Bundgaard
2025-07-29 10:52:36 +02:00
parent f5ba9dd891
commit e449b25092
2 changed files with 20 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
FROM ubuntu:22.04
LABEL author="Jeppe B"
# Set the volume for certbot
VOLUME ["/etc/letsencrypt", "/var/lib/letsencrypt"]
# Install dependencies
RUN apt-get update && \
apt-get install -y certbot python3-certbot-nginx && \
rm -rf /var/lib/apt/lists/*
# Create a directory for certbot
RUN mkdir -p /etc/letsencrypt
# Set the working directory
WORKDIR /etc/letsencrypt
# Expose port 80 for the standalone server
EXPOSE 80
# Command to run certbot in standalone mode
CMD ["certbot", "renew", "--standalone", "--non-interactive", "--agree-tos", "--email", "jb@truckwash.dk", "--no-eff-email"]
+1 -1
View File
@@ -2,7 +2,7 @@
FROM nginx:1.27.3-alpine
# Import the configuration file for Nginx
COPY nginx.conf /etc/nginx/nginx.conf
COPY /nginx/nginx.conf /etc/nginx/nginx.conf
# Copy the contents of the /app directory to the /var/www/html directory (This is not necessary for this, since we are using PHP and Nginx in separate containers - And we are not using Nginx to serve static files)
#COPY /app /var/www/html