hoppaa
This commit is contained in:
parent
0b15a19325
commit
8ded6e8358
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
|||||||
|
data/
|
||||||
@ -20,17 +20,21 @@ services:
|
|||||||
- data_mariadb:/var/lib/mysql
|
- data_mariadb:/var/lib/mysql
|
||||||
|
|
||||||
|
|
||||||
# nginx:
|
nginx:
|
||||||
# restart: always
|
restart: always
|
||||||
# build:
|
container_name: nginx
|
||||||
# context: ./requirements/nginx
|
build:
|
||||||
# dockerfile: Dockerfile
|
context: ./requirements/nginx
|
||||||
# ports:
|
dockerfile: Dockerfile
|
||||||
# - '443:443'
|
depends_on:
|
||||||
# networks:
|
- wordpress
|
||||||
# - docker-network
|
ports:
|
||||||
# volumes:
|
- '443:443'
|
||||||
# - data_wordpress:/var/www/html
|
- '80:80'
|
||||||
|
networks:
|
||||||
|
- docker-network
|
||||||
|
volumes:
|
||||||
|
- data_wordpress:/var/www/html
|
||||||
|
|
||||||
wordpress:
|
wordpress:
|
||||||
container_name: wordpress
|
container_name: wordpress
|
||||||
@ -46,8 +50,7 @@ services:
|
|||||||
- MYSQL_DATABASE=wordpress
|
- MYSQL_DATABASE=wordpress
|
||||||
- MYSQL_USER=wordpress
|
- MYSQL_USER=wordpress
|
||||||
- MYSQL_PASSWORD=42wordpress42
|
- MYSQL_PASSWORD=42wordpress42
|
||||||
- MYSQL_ROOT_PASSWORD=42root42
|
|
||||||
|
|
||||||
- DB_HOST=mariadb
|
- DB_HOST=mariadb
|
||||||
- DB_PORT=3306
|
- DB_PORT=3306
|
||||||
|
|
||||||
|
|||||||
@ -4,3 +4,6 @@ RUN apk add --no-cache \
|
|||||||
nginx &&\
|
nginx &&\
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
@ -1,20 +1,33 @@
|
|||||||
server {
|
user nginx;
|
||||||
listen 80;
|
worker_processes 1;
|
||||||
server_name ${DOMAIN_NAME};
|
|
||||||
root /var/www/html/wordpress;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/example.${DOMAIN_NAME}-access.log;
|
events {
|
||||||
error_log /var/log/nginx/example.${DOMAIN_NAME}-error.log error;
|
worker_connections 1024;
|
||||||
index index.html index.htm index.php;
|
}
|
||||||
|
|
||||||
location / {
|
http {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
include /etc/nginx/mime.types;
|
||||||
}
|
default_type application/octet-stream;
|
||||||
|
|
||||||
location ~ \.php$ {
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/example.localhost-access.log;
|
||||||
|
error_log /var/log/nginx/example.localhost-error.log error;
|
||||||
|
index index.html index.htm index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass wordpress:9000;
|
fastcgi_pass wordpress:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi.conf;
|
include fastcgi.conf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -29,6 +29,8 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
|
|||||||
chmod +x wp-cli.phar && \
|
chmod +x wp-cli.phar && \
|
||||||
mv wp-cli.phar /usr/local/bin/wp
|
mv wp-cli.phar /usr/local/bin/wp
|
||||||
|
|
||||||
|
COPY ./conf/www.conf /etc/php83/php-fpm.d/www.conf
|
||||||
|
|
||||||
RUN echo "memory_limit = 512M" >> /etc/php83/php.ini
|
RUN echo "memory_limit = 512M" >> /etc/php83/php.ini
|
||||||
|
|
||||||
# Copy and set permissions for the install script
|
# Copy and set permissions for the install script
|
||||||
|
|||||||
10
srcs/requirements/wordpress/conf/www.conf
Normal file
10
srcs/requirements/wordpress/conf/www.conf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[www]
|
||||||
|
listen = 0.0.0.0:9000
|
||||||
|
user = wordpress
|
||||||
|
group = wordpress
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 5
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
catch_workers_output = yes
|
||||||
@ -7,13 +7,19 @@ echo "Installing WordPress..."
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
# Check if the database exists
|
# Check if the database exists
|
||||||
|
|
||||||
|
echo "wp core download --allow-root --path=/var/www/html"
|
||||||
wp core download --allow-root --path=/var/www/html
|
wp core download --allow-root --path=/var/www/html
|
||||||
|
|
||||||
|
echo "wp config create --allow-root"
|
||||||
wp config create --allow-root \
|
wp config create --allow-root \
|
||||||
--dbname=$MYSQL_DATABASE \
|
--dbname=$MYSQL_DATABASE \
|
||||||
--dbuser=$MYSQL_USER \
|
--dbuser=$MYSQL_USER \
|
||||||
--dbpass=$MYSQL_PASSWORD \
|
--dbpass=$MYSQL_PASSWORD \
|
||||||
--dbhost=$DB_HOST \
|
--dbhost=$DB_HOST \
|
||||||
--path=/var/www/html
|
--path=/var/www/html
|
||||||
|
|
||||||
|
echo "wp core install --allow-root"
|
||||||
wp core install --allow-root \
|
wp core install --allow-root \
|
||||||
--url=$DOMAIN_NAME \
|
--url=$DOMAIN_NAME \
|
||||||
--title=$WP_TITLE \
|
--title=$WP_TITLE \
|
||||||
@ -21,12 +27,16 @@ wp core install --allow-root \
|
|||||||
--admin_password=$WP_ADMIN_PASSWORD \
|
--admin_password=$WP_ADMIN_PASSWORD \
|
||||||
--admin_email=$WP_ADMIN_EMAIL \
|
--admin_email=$WP_ADMIN_EMAIL \
|
||||||
--path=/var/www/html
|
--path=/var/www/html
|
||||||
|
|
||||||
|
echo "wp user create --allow-root"
|
||||||
wp user create --allow-root \
|
wp user create --allow-root \
|
||||||
$WP_USER \
|
$WP_USER \
|
||||||
$WP_USER_EMAIL \
|
$WP_USER_EMAIL \
|
||||||
--role=author \
|
--role=author \
|
||||||
--user_pass=$WP_USER_PASSWORD \
|
--user_pass=$WP_USER_PASSWORD \
|
||||||
--path=/var/www/html
|
--path=/var/www/html
|
||||||
|
|
||||||
|
echo "wp theme install --allow-root"
|
||||||
wp theme install --allow-root \
|
wp theme install --allow-root \
|
||||||
$WP_THEME \
|
$WP_THEME \
|
||||||
--activate \
|
--activate \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user