-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (23 loc) · 867 Bytes
/
Dockerfile
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
32
FROM php:8.2-apache
# Install dependencies
RUN apt-get update && \
apt-get install -y \
libzip-dev \
zip
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql zip
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Copy the application code
COPY . /var/www/html
# Enable mod_rewrite
RUN a2enmod rewrite
# Set the working directory
WORKDIR /var/www/html
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install project dependencies
RUN composer install
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache