wip trying to launch worpdress
This commit is contained in:
@@ -1,39 +1,43 @@
|
||||
# debian (~ 180s) --------------------------------------------
|
||||
|
||||
# FROM debian:buster
|
||||
#
|
||||
# # vim for debug
|
||||
# RUN apt update && apt install -y \
|
||||
# nginx openssl \
|
||||
# vim \
|
||||
# && \
|
||||
# rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
# # nginx conf
|
||||
# COPY ./conf/nginx.conf.debian /etc/nginx/nginx.conf
|
||||
# COPY ./conf/inception_nginx.conf /etc/nginx/conf.d/
|
||||
FROM debian:buster
|
||||
|
||||
# vim for debug
|
||||
RUN apt update && apt install -y \
|
||||
nginx openssl \
|
||||
vim \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# nginx conf
|
||||
COPY ./conf/nginx.conf.debian /etc/nginx/nginx.conf
|
||||
COPY ./conf/inception_nginx.conf /etc/nginx/conf.d/
|
||||
|
||||
# alpine (~ 45s) ---------------------------------------------
|
||||
|
||||
FROM alpine:3.15
|
||||
|
||||
# vim and bash for debug
|
||||
RUN apk update && apk add \
|
||||
nginx openssl \
|
||||
vim bash \
|
||||
&& \
|
||||
rm -rf /var/cache/apk*
|
||||
|
||||
# nginx conf
|
||||
COPY ./conf/nginx.conf.alpine /etc/nginx/nginx.conf
|
||||
COPY ./conf/inception_nginx.conf /etc/nginx/http.d/
|
||||
|
||||
# create user www-data and assign it to group www-data
|
||||
RUN adduser -S www-data && \
|
||||
adduser www-data www-data
|
||||
# FROM alpine:3.15
|
||||
#
|
||||
# # vim and bash for debug
|
||||
# RUN apk update && apk add \
|
||||
# nginx openssl \
|
||||
# vim bash \
|
||||
# && \
|
||||
# rm -rf /var/cache/apk*
|
||||
#
|
||||
# # nginx conf
|
||||
# COPY ./conf/nginx.conf.alpine /etc/nginx/nginx.conf
|
||||
# COPY ./conf/inception_nginx.conf /etc/nginx/http.d/
|
||||
#
|
||||
# # create user www-data and assign it to group www-data
|
||||
# RUN adduser -S www-data && \
|
||||
# adduser www-data www-data
|
||||
#
|
||||
# RUN mkdir -p /var/www/html
|
||||
|
||||
# common -----------------------------------------------------
|
||||
|
||||
RUN rm -rf /var/www/html/*
|
||||
|
||||
# personalized index.html
|
||||
COPY ./conf/index.html /data/www/
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# doc : https://nginx.org/en/docs/dirindex.html
|
||||
|
||||
# WIP redirect http to https
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
#server {
|
||||
# listen 80;
|
||||
# listen [::]:80;
|
||||
# server_name _;
|
||||
# return 301 https://$host$request_uri;
|
||||
#}
|
||||
|
||||
server {
|
||||
listen 443 ssl; # for ipv4, on port 443, specifying that accepted connections should works in ssl mode
|
||||
@@ -20,18 +20,15 @@ server {
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404; # from /etc/nginx/sites-enabled/default : First attempt to serve request as file, then as directory, then fall back to displaying a 404
|
||||
root /data/www/;
|
||||
}
|
||||
|
||||
# pass PHP scripts to FastCGI (PHP-FPM) server
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
include /etc/nginx/fastcgi.conf;
|
||||
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass wordpress:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
#fastcgi_pass wordpress:9000;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
|
||||
try_files $uri =404;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user