This commit is contained in:
xamora 2023-09-14 17:27:41 +02:00
parent 2174bd9366
commit 56d75bb43c
8 changed files with 44 additions and 4 deletions

10
.env Normal file
View file

@ -0,0 +1,10 @@
#MARIADB SETUP
MYSQL_ROOT_PASSWORD=totoflute
MYSQL_USER=bozo
MYSQL_PASSWORD=rotule
#WORDPRESS SETUP
WP_ADMIN=bozo
WP_ADMIN_PASSWORD=totoflute
WP_USER=camille
WP_USER_PASSWORD=chauvet

View file

@ -0,0 +1,9 @@
up:
mkdir -p /home/erey-bet/data/wordpress-files/
mkdir -p /home/erey-bet/data/wordpress-db/
docker-compose up --build -d
del:
docker-compose down
sudo rm -rf /home/erey-bet/data/wordpress-files/
sudo rm -rf /home/erey-bet/data/wordpress-db/

View file

@ -24,6 +24,8 @@ services:
restart: always restart: always
volumes: volumes:
- wordpress-files:/var/www/wordpress/ - wordpress-files:/var/www/wordpress/
depends_on:
- mariadb
mariadb: mariadb:
image: mariadb image: mariadb

View file

@ -1,7 +1,7 @@
FROM alpine:3.17 FROM alpine:3.17
RUN apk -U upgrade && apk add nginx openssl RUN apk -U upgrade && apk add nginx openssl
RUN openssl req -x509 -newkey rsa:2048 -days 365 -nodes \ RUN openssl req -x509 -newkey rsa:4096 -days 365 -nodes \
-keyout /etc/ssl/private/erey-bet.42.fr_key.pem \ -keyout /etc/ssl/private/erey-bet.42.fr_key.pem \
-out /etc/ssl/certs/erey-bet.42.fr_cert.pem -sha256 \ -out /etc/ssl/certs/erey-bet.42.fr_cert.pem -sha256 \
-subj "/C=FR/ST=Nouvelle Aquitaine/L=Angouleme/ \ -subj "/C=FR/ST=Nouvelle Aquitaine/L=Angouleme/ \

View file

@ -17,7 +17,7 @@ server {
ssl_certificate /etc/ssl/certs/erey-bet.42.fr_cert.pem; ssl_certificate /etc/ssl/certs/erey-bet.42.fr_cert.pem;
ssl_certificate_key /etc/ssl/private/erey-bet.42.fr_key.pem; ssl_certificate_key /etc/ssl/private/erey-bet.42.fr_key.pem;
ssl_protocols TLSv1.2; ssl_protocols TLSv1.3;
location / { location / {
# This is cool because no php is touched for static content. # This is cool because no php is touched for static content.

View file

@ -3,14 +3,19 @@ FROM alpine:3.17
RUN apk -U upgrade RUN apk -U upgrade
RUN apk add sudo coreutils php php-phar php-fpm php-mysqli php-iconv mysql-client \ RUN apk add sudo coreutils php php-phar php-fpm php-mysqli php-iconv mysql-client \
php-json php-curl php-dom php-exif php-fileinfo php-mbstring php-openssl php-xml php-zip \ php-json php-curl php-dom php-exif php-fileinfo php-mbstring php-openssl php-xml php-zip \
php-tokenizer php-session php-tokenizer php-session curl
RUN mkdir -p /var/www/ RUN mkdir -p /var/www/
WORKDIR /var/www/ WORKDIR /var/www/
RUN wget https://wordpress.org/latest.tar.gz RUN wget https://wordpress.org/latest.tar.gz
RUN tar -xzvf latest.tar.gz RUN tar -xzvf latest.tar.gz
RUN rm latest.tar.gz RUN rm latest.tar.gz
WORKDIR /var/www/wordpress/
RUN wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar && mv wp-cli.phar /bin/wp
COPY php.conf /etc/php81/php-fpm.d/www.conf COPY php.conf /etc/php81/php-fpm.d/www.conf
COPY bash.sh /etc/
ENTRYPOINT ["php-fpm81", "-F"] ENTRYPOINT ["sh", "/etc/bash.sh"]

View file

@ -0,0 +1,11 @@
wp config create --dbname=wordpress --dbuser="Bozo" \
--dbpass="BozoPassword" --dbhost=mariadb --force
wp core is-installed || wp core install --url=erey-bet.42.fr --title="BozoLand" --admin_user="erey-bet" \
--admin_password="totoflute" --admin_email="erey-bet"@mail.org --skip-email
wp user create "kdx2a" "kdx2a"@mail.org --user_pass="kdx2a"
wp theme install twentytwentytwo --activate
exec php-fpm81 -F

3
todo Normal file
View file

@ -0,0 +1,3 @@
- Automatiser l'install wp
- Save les creds dans un .env
- Makefile