mariadb finis

This commit is contained in:
0x00000000
2025-06-16 17:26:48 +02:00
parent c43ec976be
commit d33f0f31e7
4 changed files with 30 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
FROM debian:bullseye
RUN apt update -y
RUN apt upgrade -y
RUN apt install mariadb-server -y
COPY conf/50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf
COPY tools/script.sh /tools/script.sh
ENTRYPOINT ["sh", "/tools/script.sh"]
@@ -0,0 +1,6 @@
[mysqld]
datadir = /var/lib/mysql
socket = /run/mysqld/mysqld.sock
bind_address=*
port = 3306
user = mysql
+14
View File
@@ -0,0 +1,14 @@
service mysql start;
mysql -e "CREATE DATABASE IF NOT EXISTS \`${SQL_DATABASE}\`;"
mysql -e "CREATE USER IF NOT EXISTS \`${SQL_USER}\`@'localhost' IDENTIFIED BY '${SQL_PASSWORD}';"
mysql -e "GRANT ALL PRIVILEGES ON \`${SQL_DATABASE}\`.* TO \`${SQL_USER}\`@'%' IDENTIFIED BY '${SQL_PASSWORD}';"
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${SQL_ROOT_PASSWORD}';"
mysql -e "FLUSH PRIVILEGES;"
mysqladmin -u root -p$SQL_ROOT_PASSWORD shutdown
exec mysqld_safe
+3 -2
View File
@@ -1,5 +1,6 @@
FROM debian:bullseye
RUN apt update
RUN apt update -y
RUN apt upgrade -y
RUN apt install nginx -y
RUN apt install vim -y
RUN apt install curl -y
@@ -10,4 +11,4 @@ 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
CMD [ "nginx", "-g", "daemon off;" ]
ENTRYPOINT [ "nginx", "-g", "daemon off;" ]