services/srcs/nginx/Dockerfile

26 lines
889 B
Docker
Raw Permalink Normal View History

2023-03-01 04:35:44 +01:00
FROM alpine
RUN sleep 10
RUN apk update
RUN apk add openssh
RUN apk add openssl
RUN apk add nginx
RUN apk add telegraf
COPY srcs/start.sh /root/start.sh
COPY srcs/nginx.conf /etc/nginx/nginx.conf
COPY srcs/index.html /var/www/index.html
COPY srcs/telegraf.conf /etc/telegraf/telegraf.conf
WORKDIR /root/
RUN adduser --disabled-password admin
RUN echo "admin:password" | chpasswd
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
RUN ssh-keygen -A
CMD sh start.sh
EXPOSE 80/tcp
EXPOSE 443/tcp
EXPOSE 22/tcp