compile from all place
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
nginx \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY conf/nginx.conf /etc/nginx/sites-available/wordpress.conf
|
||||
COPY tools/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
RUN rm -f /etc/nginx/sites-enabled/default \
|
||||
&& ln -s /etc/nginx/sites-available/wordpress.conf /etc/nginx/sites-enabled/wordpress.conf \
|
||||
&& mkdir -p /etc/nginx/ssl \
|
||||
&& chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
EXPOSE 443
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
@@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
|
||||
server_name oriabenk.42.fr;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/inception.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/inception.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass wordpress:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f /etc/nginx/ssl/inception.crt ]; then
|
||||
openssl req -x509 -nodes -days 365 \
|
||||
-newkey rsa:2048 \
|
||||
-keyout /etc/nginx/ssl/inception.key \
|
||||
-out /etc/nginx/ssl/inception.crt \
|
||||
-subj "/C=UA/ST=Kyiv/L=Kyiv/O=42/OU=42/CN=${DOMAIN_NAME}"
|
||||
fi
|
||||
|
||||
exec nginx -g "daemon off;"
|
||||
Reference in New Issue
Block a user