-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 808 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 808 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
31
# Use the official PHP Apache base image
FROM php:7.4-apache
# Update the package list and install system tools
RUN apt-get update && apt-get install -y \
unzip \
libzip-dev
# Enable the Apache rewritemod module
RUN a2enmod rewrite
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --version=2.1.14 --install-dir=/usr/local/bin --filename=composer
# Copy composer file to the /var/www/html directory
COPY composer.json /var/www/html/
# Install Composer dependencies
RUN composer install
# Copy project files to the /var/www/html directory
COPY . /var/www/html
# Ensure that the owner of files in the /var/www/html directory is www-data
RUN chown -R www-data:www-data /var/www/html
# Port on which Apache will run
EXPOSE 80
# Start command
CMD ["apache2-foreground"]