stat-utas commited on
Commit
d2cdd68
·
verified ·
1 Parent(s): d497428

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -1
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use the official MariaDB image from the Docker Hub
2
  FROM mariadb:latest
3
 
4
  # Environment variables for MariaDB setup
@@ -7,5 +7,18 @@ ENV MYSQL_DATABASE=moodledb
7
  ENV MYSQL_USER=moodleuser
8
  ENV MYSQL_PASSWORD=moodlepassword
9
 
 
 
 
 
 
 
 
10
  # Expose the MariaDB port
11
  EXPOSE 3306
 
 
 
 
 
 
 
1
+ # Use the official MariaDB image as a base
2
  FROM mariadb:latest
3
 
4
  # Environment variables for MariaDB setup
 
7
  ENV MYSQL_USER=moodleuser
8
  ENV MYSQL_PASSWORD=moodlepassword
9
 
10
+ # Ensure that the necessary directories and files have the correct permissions
11
+ USER root
12
+ RUN chown -R mysql:mysql /var/lib/mysql /var/log/mysql
13
+
14
+ # Copy custom configuration files if you have any
15
+ # COPY my.cnf /etc/mysql/my.cnf
16
+
17
  # Expose the MariaDB port
18
  EXPOSE 3306
19
+
20
+ # Switch back to the MariaDB user
21
+ USER mysql
22
+
23
+ # Command to start MariaDB
24
+ CMD ["mysqld"]