This commit is contained in:
Danny Houtworm 2023-08-10 06:16:08 +00:00
parent f192cb9509
commit 3c1a42e9bb
6 changed files with 625 additions and 15 deletions

View File

@ -2,12 +2,12 @@ all: up
build: build:
sudo docker network create --subnet=172.20.30.0/24 wordpress sudo docker network create --subnet=172.20.30.0/24 wordpress
sudo mkdir ./build ~/data sudo mkdir ./build /home/djonker/data
sudo curl -f https://wordpress.org/latest.tar.gz --output ~/data/latest.tar.gz sudo curl -f https://wordpress.org/latest.tar.gz --output /home/djonker/data/latest.tar.gz
sudo tar -xvf ~/data/latest.tar.gz sudo tar -xvf /home/djonker/data/latest.tar.gz
sudo mv wordpress ~/data/wordpress sudo mv wordpress /home/djonker/data/wordpress
sudo cp srcs/requirements/wordpress/srcs/wordpress.conf ~/data/wordpress/wp-config.php sudo cp srcs/requirements/wordpress/srcs/wordpress.conf /home/djonker/data/wordpress/wp-config.php
sudo chown -R root:root ~/data/wordpress sudo chown -R root:root /home/djonker/data/wordpress
up: build up: build
sudo docker-compose -f ./srcs/docker-compose.yml up -d sudo docker-compose -f ./srcs/docker-compose.yml up -d
@ -17,4 +17,4 @@ down:
clean: down clean: down
yes | sudo docker system prune -a yes | sudo docker system prune -a
sudo rm -rf ~/data ./build sudo rm -rf /home/djonker/data ./build

View File

@ -8,7 +8,7 @@ services:
container_name: nginx container_name: nginx
restart: always restart: always
volumes: volumes:
- ~/data/wordpress:/var/www/wordpress - /home/djonker/data/wordpress:/var/www/wordpress
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
@ -25,9 +25,9 @@ services:
container_name: mariadb container_name: mariadb
restart: always restart: always
volumes: volumes:
- ~/data/mariadb/data:/var/lib/mysql - /home/djonker/data/mariadb/data:/var/lib/mysql
- ~/data/mariadb/config:/etc/mysql/conf.d - /home/djonker/data/mariadb/config:/etc/mysql/conf.d
- ~/data/mariadb/logs:/var/log/mysql - /home/djonker/data/mariadb/logs:/var/log/mysql
networks: networks:
wordpress: wordpress:
ipv4_address: 172.20.30.20 ipv4_address: 172.20.30.20
@ -36,7 +36,7 @@ services:
container_name: wordpress container_name: wordpress
restart: always restart: always
volumes: volumes:
- ~/data/wordpress:/var/www/wordpress - /home/djonker/data/wordpress:/var/www/wordpress
networks: networks:
wordpress: wordpress:
ipv4_address: 172.20.30.30 ipv4_address: 172.20.30.30

View File

@ -8,7 +8,7 @@ RUN apk add mariadb
RUN apk add mariadb-client RUN apk add mariadb-client
COPY srcs/start.sh /root/start.sh COPY srcs/start.sh /root/start.sh
COPY srcs/my.cnf /etc/my.cnf.d/mariadb-server.cnf COPY srcs/my.cnf /etc/my.cnf.d/mariadb-server.cnf
COPY srcs/maria.sql /root/maria.sql COPY srcs/wordpress.sql /root/wordpress.sql
WORKDIR /root/ WORKDIR /root/
RUN mkdir -p /run/mysqld RUN mkdir -p /run/mysqld
RUN chown -R mysql:mysql /run/mysqld /var/lib/mysql RUN chown -R mysql:mysql /run/mysqld /var/lib/mysql

View File

@ -5,7 +5,7 @@ then
else else
mysql_install_db --user=mysql --datadir=/var/lib/mysql mysql_install_db --user=mysql --datadir=/var/lib/mysql
mysqld & sleep 10 mysqld & sleep 10
#mysql < maria.sql mysql < wordpress.sql
mysql -e "CREATE DATABASE $WORDPRESSDATABASE" mysql -e "CREATE DATABASE $WORDPRESSDATABASE"
mysql -e "GRANT ALL PRIVILEGES ON $WORDPRESSDATABASE.* TO $WORDPRESSDATABASEUSER@172.20.30.30 IDENTIFIED BY '$WORDPRESSDATABASEPASSWD'" mysql -e "GRANT ALL PRIVILEGES ON $WORDPRESSDATABASE.* TO $WORDPRESSDATABASEUSER@172.20.30.30 IDENTIFIED BY '$WORDPRESSDATABASEPASSWD'"
killall mysqld killall mysqld

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ http {
index index.php; index index.php;
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_timeout 10m; ssl_session_timeout 10m;
keepalive_timeout 70; keepalive_timeout 50;
location / { location / {
try_files $uri /index.php?$args; try_files $uri /index.php?$args;