-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (41 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
52 lines (41 loc) · 1.39 KB
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
43
44
45
46
47
48
49
50
51
52
FROM php:8.2-apache
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
zip \
unzip \
libldap2-dev \
libldap-common \
&& docker-php-ext-configure ldap \
&& docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd zip ldap \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Enable Apache mod_rewrite and headers
RUN a2enmod rewrite headers
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY . /var/www/html
# Install PHP dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Create required directories and set permissions
RUN mkdir -p data logs uploads tmp/cache \
&& chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html \
&& chmod -R 775 data logs uploads tmp
# Configure Apache
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
# Update PHP configuration
RUN echo "upload_max_filesize = 10M" > /usr/local/etc/php/conf.d/uploads.ini \
&& echo "post_max_size = 10M" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/uploads.ini
# Expose port 80
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]