-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 940 Bytes
/
Copy pathDockerfile
File metadata and controls
42 lines (30 loc) · 940 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
32
33
34
35
36
37
38
39
40
41
42
# Dockerfile
FROM php:apache
# Install dependencies
RUN apt-get update && apt-get install -y \
git \
libbrotli-dev
# Enable mod_rewrite, mod_deflate, and mod_brotli
RUN a2enmod rewrite
RUN a2enmod deflate
RUN a2enmod brotli
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy the entire project
COPY . /app
# Set working directory
WORKDIR /app
# Copy custom Apache configuration
COPY apache.conf /etc/apache2/sites-available/000-default.conf
# Create logs directory and set permissions
RUN mkdir -p /app/logs && chmod -R 755 /app/logs
# Set permissions for the www directory
RUN chown -R www-data:www-data /app/www && chmod -R 755 /app/www
# Copy php.ini
COPY php.ini /usr/local/etc/php/
# Enable the site configuration
RUN a2ensite 000-default.conf
# Install Composer dependencies
RUN composer install
# Start Apache
CMD ["apache2-foreground"]