-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
30 lines (22 loc) · 854 Bytes
/
dockerfile
File metadata and controls
30 lines (22 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use the official Moodle image as a base images
FROM moodlehq/moodle-php-apache:7.4
# Copy the existing Moodle code into the container
COPY www/html/ .
# Copy the moodledata directory
COPY moodledata /var/moodledata
# Set up Apache configuration
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite
# Give ownership to www-data user and group
RUN chown -R www-data:www-data /var/www/html
RUN chown -R www-data:www-data /var/moodledata
# Set read and execute permissions for the web server user
RUN chmod -R 755 /var/www/html
RUN chmod -R 755 /var/moodledata
# Set up the required Moodle directories
RUN mkdir -p /var/moodledata/cache /var/moodledata/localcache
RUN chown -R www-data:www-data /var/moodledata/cache /var/moodledata/localcache
# Expose ports
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]