aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile26
-rw-r--r--srcs/conf/test.com22
-rw-r--r--srcs/wordpress/wp-config.php4
3 files changed, 26 insertions, 26 deletions
diff --git a/Dockerfile b/Dockerfile
index 28f93bc..7b0c0e6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,22 +2,28 @@ FROM debian:buster
RUN apt update && \
apt install -y nginx \
- mariadb-server \
php-fpm \
- php-mysql \
- phpmyadmin \
- php-mbstring \
- php-gettext
+ mariadb-server \
+ php-mysql
+ # phpmyadmin \
+ # php-mbstring \
+ # php-gettext
-COPY srcs/wordpress /var/www/html
COPY srcs/conf /etc/nginx/sites-available/
+COPY srcs/wordpress /var/www
+# COPY srcs/test /var/www
RUN ln -fs /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/default
EXPOSE 80
-RUN service nginx start && \
- service mysql start && \
- service php7.3-fpm start
+RUN service mysql start && \
+ echo "CREATE DATABASE testdb;" | mysql -u root && \
+ echo "CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY '';" | mysql -u root && \
+ echo "GRANT ALL PRIVILEGES ON testdb.* TO 'wordpressuser'@'localhost' IDENTIFIED BY '';" | mysql -u root && \
+ echo "FLUSH PRIVILEGES;" | mysql -u root
-CMD sleep infinity & wait
+CMD service php7.3-fpm start && \
+ service mysql start && \
+ service nginx start && \
+ sleep infinity & wait
diff --git a/srcs/conf/test.com b/srcs/conf/test.com
index 866f8ad..dac8f88 100644
--- a/srcs/conf/test.com
+++ b/srcs/conf/test.com
@@ -1,27 +1,21 @@
server {
- listen 80; # listen all ip on port 80 (0.0.0.0:80)
- root /var/www/html; # where to find files for location blocks
- server_name test.com; # domain name
- index index.php index.html index.htm; # files for empty uri
+ listen 80; # listen all ip on port 80 (0.0.0.0:80)
+ root /var/www; # where to find files for location blocks
+ server_name localhost; # domain name
+ index index.php index.html; # files for empty uri
# all uri
location / {
- try_files $uri $uri/ =404; # if uri or uri/ no valid, 404 error
+ try_files $uri $uri/ =404; # if uri or uri/ not valid, 404 error
}
# php files
location ~ \.php$ {
- try_files $uri =404; # try file in uri, if not found fallthrough 404 error
-
- # php fpm proxy
- fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; # socket where php fpm is running
- fastcgi_index index.php # php fpm default index
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # idk yet
- include snippets/fastcgi-php.conf; # include php fpm settings
+ include snippets/fastcgi-php.conf; # include php fpm settings
+ fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; # socket where php fpm is running
}
- # configuration files
- # deny access and no logs
+ # configuration files, deny access and no logs
location ~ /\. {
deny all;
access_log off;
diff --git a/srcs/wordpress/wp-config.php b/srcs/wordpress/wp-config.php
index 66d588c..2f2d89c 100644
--- a/srcs/wordpress/wp-config.php
+++ b/srcs/wordpress/wp-config.php
@@ -23,10 +23,10 @@
define( 'DB_NAME', 'testdb' );
/** MySQL database username */
-define( 'DB_USER', 'root' );
+define( 'DB_USER', 'wordpressuser' );
/** MySQL database password */
-define( 'DB_PASSWORD', 'root' );
+define( 'DB_PASSWORD', '' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );