-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
38 lines (29 loc) · 1 KB
/
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
33
34
35
36
37
38
# Dockerfile
FROM php:8.3-apache
# Install necessary packages
RUN apt-get update && apt-get install -y \
libzip-dev \
zip \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
git
# Install necessary PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo_mysql zip
# Activate Apache modules headers & rewrite
RUN a2enmod headers rewrite
# Copy virtual host configuration from current path onto existing 000-default.conf
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
# Set the working directory and copy the composer.json and composer.lock files
WORKDIR /var/www/html
COPY composer.json composer.lock ./
# Copy Composer from the official Composer image
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install Composer dependencies
RUN composer install --no-dev --optimize-autoloader
# Expose port 80 for web traffic
EXPOSE 80
# Start the Apache server
CMD ["apache2-foreground"]