stat-utas commited on
Commit
7219b52
·
verified ·
1 Parent(s): 0774b9b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -14
Dockerfile CHANGED
@@ -1,18 +1,31 @@
1
- FROM php:7.4-fpm
 
2
 
3
- # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive
5
  ENV TZ=America/New_York
6
 
7
- # Install required packages and clean up
8
- RUN apt-get update && apt-get install -y \
 
9
  nginx \
10
- mariadb-client \
11
  mariadb-server \
 
 
 
 
 
12
  curl \
 
 
13
  tzdata && \
14
  rm -rf /var/lib/apt/lists/*
15
 
 
 
 
 
 
16
  # Set the working directory
17
  WORKDIR /var/www/html
18
 
@@ -27,17 +40,14 @@ RUN curl -L https://download.moodle.org/download.php/direct/stable39/moodle-late
27
  RUN chown -R www-data:www-data /var/www/html && \
28
  chmod -R 755 /var/www/html
29
 
30
- # Create and configure a new data directory for MariaDB
31
- RUN mkdir -p /var/lib/mysql && \
32
- chown -R mysql:mysql /var/lib/mysql && \
33
- chmod -R 750 /var/lib/mysql
34
-
35
  # Create necessary directories and set permissions for MariaDB
36
- RUN mkdir -p /run/mysqld && \
37
- chown -R mysql:mysql /run/mysqld && \
38
- chmod 750 /run/mysqld
 
 
39
 
40
- # Copy MariaDB configuration
41
  COPY my.cnf /etc/mysql/my.cnf
42
 
43
  # Configure Nginx
 
1
+ # Use the official Ubuntu base image
2
+ FROM ubuntu:20.04
3
 
4
+ # Set environment variables for non-interactive installation
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV TZ=America/New_York
7
 
8
+ # Update package list and install required packages
9
+ RUN apt-get update && \
10
+ apt-get install -y \
11
  nginx \
 
12
  mariadb-server \
13
+ php-fpm \
14
+ php-mysql \
15
+ php-xml \
16
+ php-gd \
17
+ php-mbstring \
18
  curl \
19
+ vim \
20
+ unzip \
21
  tzdata && \
22
  rm -rf /var/lib/apt/lists/*
23
 
24
+ # Configure timezone
25
+ RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
26
+ echo $TZ > /etc/timezone && \
27
+ dpkg-reconfigure -f noninteractive tzdata
28
+
29
  # Set the working directory
30
  WORKDIR /var/www/html
31
 
 
40
  RUN chown -R www-data:www-data /var/www/html && \
41
  chmod -R 755 /var/www/html
42
 
 
 
 
 
 
43
  # Create necessary directories and set permissions for MariaDB
44
+ RUN mkdir -p /var/run/mysqld && \
45
+ mkdir -p /var/lib/mysql && \
46
+ chown -R mysql:mysql /var/run/mysqld /var/lib/mysql && \
47
+ chmod 750 /var/run/mysqld && \
48
+ chmod 750 /var/lib/mysql
49
 
50
+ # Configure MariaDB
51
  COPY my.cnf /etc/mysql/my.cnf
52
 
53
  # Configure Nginx