BIENTOT
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
FROM debian:bullseye
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y nginx openssl && \
|
||||
mkdir -p /etc/nginx/ssl /var/run/nginx && \
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout /etc/ssl/private/server_pkey.pem \
|
||||
-out /etc/nginx/ssl/server.crt \
|
||||
-subj "/C=FR/ST=IDF/L=Paris/O=42/OU=42/CN=yantoine.42.fr/UID=yantoine"
|
||||
RUN apk add --no-cache nginx openssl
|
||||
|
||||
COPY conf/nginx.conf /etc/nginx/sites-available/nginx.conf
|
||||
COPY conf/default.conf /etc/nginx/http.d/default.conf
|
||||
COPY tools/generate_ssl.sh /tmp/generate_ssl.sh
|
||||
|
||||
# Suppression du site par défaut et activation de la nouvelle configuration
|
||||
RUN rm /etc/nginx/sites-enabled/default && \
|
||||
ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled/
|
||||
RUN chmod +x /tmp/generate_ssl.sh && /tmp/generate_ssl.sh
|
||||
|
||||
EXPOSE 443
|
||||
|
||||
ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user