FROM nginx:1.31.1-trixie

RUN apt update && apt install -y openssl && rm -rf /var/lib/apt/lists/*

WORKDIR /cert
COPY openssl.cnf openssl.cnf
RUN openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -config openssl.cnf

COPY default.conf /etc/nginx/conf.d/default.conf
COPY index.html /usr/share/nginx/html/index.html
