s'occuper de worDdpress
This commit is contained in:
+62
-60
@@ -1,65 +1,67 @@
|
||||
services:
|
||||
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"
|
||||
version: "3"
|
||||
|
||||
nginx:
|
||||
container_name: nginx
|
||||
volumes:
|
||||
- wordpress:/var/www/wordpress
|
||||
networks:
|
||||
- inception
|
||||
depends_on:
|
||||
- wordpress
|
||||
build:
|
||||
context: ./requirements/nginx
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
ports:
|
||||
- "443:443"
|
||||
restart: on-failure
|
||||
services:
|
||||
nginx:
|
||||
container_name: nginx
|
||||
volumes:
|
||||
- wordpress:/var/www/wordpress
|
||||
networks:
|
||||
- inception
|
||||
depends_on:
|
||||
- wordpress
|
||||
build:
|
||||
context: ./requirements/nginx
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
ports:
|
||||
- "443:443"
|
||||
restart: always
|
||||
|
||||
wordpress:
|
||||
container_name: wordpress
|
||||
env_file: .env
|
||||
volumes:
|
||||
- wordpress:/var/www/wordpress
|
||||
networks:
|
||||
- inception
|
||||
build:
|
||||
context: ./requirements/wordpress
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
- mariadb
|
||||
restart: on-failure
|
||||
expose:
|
||||
- "9000"
|
||||
wordpress:
|
||||
container_name: wordpress
|
||||
env_file: .env
|
||||
volumes:
|
||||
- wordpress:/var/www/wordpress
|
||||
networks:
|
||||
- inception
|
||||
build:
|
||||
context: ./requirements/wordpress
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
- mariadb
|
||||
restart: always
|
||||
expose:
|
||||
- "9000"
|
||||
|
||||
volumes:
|
||||
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'
|
||||
mariadb:
|
||||
container_name: mariadb
|
||||
networks:
|
||||
- inception
|
||||
build:
|
||||
context: ./requirements/mariadb
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
volumes:
|
||||
- mariadb:/var/lib/mysql
|
||||
restart: always
|
||||
expose:
|
||||
- "3306"
|
||||
|
||||
networks:
|
||||
inception:
|
||||
driver: bridge
|
||||
volumes:
|
||||
wordpress:
|
||||
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 upgrade -y
|
||||
RUN apt install nginx -y
|
||||
RUN apt install vim -y
|
||||
RUN apt install curl -y
|
||||
RUN apt install openssl -y
|
||||
RUN mkdir -p /etc/nginx/ssl
|
||||
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
|
||||
RUN chmod 755 /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
|
||||
root /var/www/html;
|
||||
server_name yantoine.42.fr;
|
||||
#index;
|
||||
index index.php
|
||||
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
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;
|
||||
# Pour toutes les requetes php
|
||||
location ~ [^/]\.php(/|$) {
|
||||
try_files $uri =404;
|
||||
fastcgi_pass wordpress:9000;
|
||||
include snippets/fastcgi-php.conf;
|
||||
#fastcgi_index index.php;
|
||||
#include fastcgi_params;
|
||||
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
#fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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