s'occuper de worDdpress
This commit is contained in:
+62
-60
@@ -1,65 +1,67 @@
|
|||||||
services:
|
version: "3"
|
||||||
mariadb:
|
|
||||||
container_name: mariadb
|
|
||||||
networks:
|
|
||||||
- inception
|
|
||||||
build:
|
|
||||||
context: ./requirements/mariadb
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
env_file: .env
|
|
||||||
volumes:
|
|
||||||
- mariadb:/var/lib/mysql
|
|
||||||
restart: unless-stopped
|
|
||||||
expose:
|
|
||||||
- "3306"
|
|
||||||
|
|
||||||
nginx:
|
services:
|
||||||
container_name: nginx
|
nginx:
|
||||||
volumes:
|
container_name: nginx
|
||||||
- wordpress:/var/www/wordpress
|
volumes:
|
||||||
networks:
|
- wordpress:/var/www/wordpress
|
||||||
- inception
|
networks:
|
||||||
depends_on:
|
- inception
|
||||||
- wordpress
|
depends_on:
|
||||||
build:
|
- wordpress
|
||||||
context: ./requirements/nginx
|
build:
|
||||||
dockerfile: Dockerfile
|
context: ./requirements/nginx
|
||||||
env_file: .env
|
dockerfile: Dockerfile
|
||||||
ports:
|
env_file: .env
|
||||||
- "443:443"
|
ports:
|
||||||
restart: on-failure
|
- "443:443"
|
||||||
|
restart: always
|
||||||
|
|
||||||
wordpress:
|
wordpress:
|
||||||
container_name: wordpress
|
container_name: wordpress
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- wordpress:/var/www/wordpress
|
- wordpress:/var/www/wordpress
|
||||||
networks:
|
networks:
|
||||||
- inception
|
- inception
|
||||||
build:
|
build:
|
||||||
context: ./requirements/wordpress
|
context: ./requirements/wordpress
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
restart: on-failure
|
restart: always
|
||||||
expose:
|
expose:
|
||||||
- "9000"
|
- "9000"
|
||||||
|
|
||||||
volumes:
|
mariadb:
|
||||||
wordpress:
|
container_name: mariadb
|
||||||
driver: local
|
networks:
|
||||||
driver_opts:
|
- inception
|
||||||
type: 'none'
|
build:
|
||||||
o: 'bind'
|
context: ./requirements/mariadb
|
||||||
device: '/home/yantoine/data/wordpress'
|
dockerfile: Dockerfile
|
||||||
mariadb:
|
env_file: .env
|
||||||
driver: local
|
volumes:
|
||||||
driver_opts:
|
- mariadb:/var/lib/mysql
|
||||||
type: 'none'
|
restart: always
|
||||||
o: 'bind'
|
expose:
|
||||||
device: '/home/yantoine/data/mariadb'
|
- "3306"
|
||||||
|
|
||||||
networks:
|
volumes:
|
||||||
inception:
|
wordpress:
|
||||||
driver: bridge
|
name: wordpress
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: bind
|
||||||
|
device: /home/yantoine/data/wordpress
|
||||||
|
mariadb:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: bind
|
||||||
|
device: /home/yantoine/data/mariadb
|
||||||
|
|
||||||
|
networks:
|
||||||
|
inception:
|
||||||
|
driver: bridge
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ FROM debian:bullseye
|
|||||||
RUN apt update -y
|
RUN apt update -y
|
||||||
RUN apt upgrade -y
|
RUN apt upgrade -y
|
||||||
RUN apt install nginx -y
|
RUN apt install nginx -y
|
||||||
RUN apt install vim -y
|
|
||||||
RUN apt install curl -y
|
|
||||||
RUN apt install openssl -y
|
RUN apt install openssl -y
|
||||||
RUN mkdir -p /etc/nginx/ssl
|
RUN mkdir -p /etc/nginx/ssl
|
||||||
RUN mkdir -p /var/run/nginx
|
RUN mkdir -p /var/run/nginx
|
||||||
@@ -11,4 +9,6 @@ RUN openssl req -x509 -nodes -out /etc/nginx/ssl/inception.crt -keyout /etc/ngin
|
|||||||
COPY conf/nginx.conf /etc/nginx/nginx.conf
|
COPY conf/nginx.conf /etc/nginx/nginx.conf
|
||||||
RUN chmod 755 /var/www/html
|
RUN chmod 755 /var/www/html
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
ENTRYPOINT [ "nginx", "-g", "daemon off;" ]
|
COPY ./tools/run.sh /run.sh
|
||||||
|
RUN chmod +x /run.sh
|
||||||
|
ENTRYPOINT ["/run.sh"]
|
||||||
|
|||||||
@@ -1,92 +1,25 @@
|
|||||||
|
server {
|
||||||
|
#SSL/TLS Configuration
|
||||||
|
listen 443 ssl;
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
ssl_protocols TLSv1.3;
|
||||||
|
ssl_certificate /etc/nginx/ssl/inception.crt;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/inception.key;
|
||||||
|
|
||||||
|
#root and index and server_name
|
||||||
user www-data;
|
root /var/www/html;
|
||||||
worker_processes auto;
|
server_name yantoine.42.fr;
|
||||||
pid /run/nginx.pid;
|
#index;
|
||||||
include /etc/nginx/modules-enabled/*.conf;
|
index index.php
|
||||||
|
|
||||||
events {
|
# Pour toutes les requetes php
|
||||||
worker_connections 768;
|
location ~ [^/]\.php(/|$) {
|
||||||
# multi_accept on;
|
try_files $uri =404;
|
||||||
}
|
fastcgi_pass wordpress:9000;
|
||||||
|
|
||||||
http {
|
|
||||||
##
|
|
||||||
# Basic Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
types_hash_max_size 2048;
|
|
||||||
# server_tokens off;
|
|
||||||
|
|
||||||
# server_names_hash_bucket_size 64;
|
|
||||||
# server_name_in_redirect off;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
##
|
|
||||||
# SSL Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Logging Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log;
|
|
||||||
error_log /var/log/nginx/error.log;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Gzip Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
|
|
||||||
# gzip_vary on;
|
|
||||||
# gzip_proxied any;
|
|
||||||
# gzip_comp_level 6;
|
|
||||||
# gzip_buffers 16 8k;
|
|
||||||
# gzip_http_version 1.1;
|
|
||||||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Virtual Host Configs
|
|
||||||
##
|
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
|
||||||
include /etc/nginx/sites-enabled/*;
|
|
||||||
|
|
||||||
server {
|
|
||||||
#SSL/TLS Configuration
|
|
||||||
listen 443 ssl;
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_certificate /etc/nginx/ssl/inception.crt;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/inception.key;
|
|
||||||
|
|
||||||
#root and index and server_name
|
|
||||||
root /var/www/html;
|
|
||||||
server_name yantoine.42.fr;
|
|
||||||
#index;
|
|
||||||
index index.php index.html index.htm;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pour toutes les requetes php
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_pass wordpress:9000;
|
|
||||||
include snippets/fastcgi-php.conf;
|
include snippets/fastcgi-php.conf;
|
||||||
#fastcgi_index index.php;
|
include fastcgi_params;
|
||||||
#include fastcgi_params;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
}
|
||||||
#fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
#server_name yantoine.42.fr
|
||||||
|
ssl_certificate /etc/nginx/ssl/inception.crt;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/inception.key;" > /etc/nginx/sites-available/default
|
||||||
|
|
||||||
|
|
||||||
|
echo '
|
||||||
|
ssl_protocols TLSv1.3;
|
||||||
|
index index.php
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_pass wordpress:9000;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
}
|
||||||
|
} ' >> /etc/nginx/sites-available/default
|
||||||
|
|
||||||
|
|
||||||
|
nginx -g "daemon off;"
|
||||||
Reference in New Issue
Block a user