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"]