forked from guaycuru/gde
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
62 lines (50 loc) · 1.37 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
53
54
55
56
57
58
59
60
61
62
FROM php:8.1-apache
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libicu-dev \
libonig-dev \
libxml2-dev \
libcurl4-openssl-dev \
git \
unzip \
curl \
&& rm -rf /var/lib/apt/lists/*
# Configure and install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
pdo \
pdo_mysql \
mysqli \
mbstring \
zip \
intl \
opcache \
xml \
curl
# Enable Apache modules
RUN a2enmod rewrite
RUN a2enmod headers
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY . .
# Install PHP dependencies
RUN composer install --no-dev --optimize-autoloader --ignore-platform-reqs
# Regenerate autoloader without platform checks
RUN composer dump-autoload --no-dev --optimize --ignore-platform-reqs
# Copy custom Apache configuration
COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
# Copy custom PHP configuration
COPY docker/php.ini /usr/local/etc/php/conf.d/99-custom.ini
# Set proper permissions
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
# Expose port 80
EXPOSE 80