inception/srcs/requirements/nginx/Dockerfile

19 lines
722 B
Docker
Raw Normal View History

2023-08-14 10:41:31 +02:00
FROM alpine:3.18.3
2023-06-25 05:25:27 +02:00
RUN sleep 10
RUN apk update
RUN apk add openssl
RUN apk add nginx
COPY srcs/nginx.conf /etc/nginx/nginx.conf
2023-08-09 22:52:57 +02:00
COPY srcs/index.html /var/www/html/index.html
COPY srcs/style.css /var/www/html/style.css
2023-06-25 05:25:27 +02:00
WORKDIR /root/
RUN openssl genrsa -out nginx.key
RUN openssl req -new -key nginx.key -out nginx.csr -subj "/C=NL/ST=Friesland/L=Heerenveen/O=localhost/OU=localhost/CN=localhost/emailAddress=djonker@student.codam.nl"
RUN openssl x509 -req -days 365 -in nginx.csr -signkey nginx.key -out nginx.crt
RUN mv nginx.crt /etc/ssl/certs/nginx.crt
RUN mv nginx.key /etc/ssl/private/nginx.key
RUN chmod 600 /etc/ssl/certs/nginx.crt /etc/ssl/private/nginx.key
2023-08-10 10:32:03 +02:00
CMD nginx -g 'daemon off;'
2023-06-25 05:25:27 +02:00
EXPOSE 80/tcp
EXPOSE 443/tcp