-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
37 lines (29 loc) · 947 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
33
34
35
36
37
# Use the official PHP image with Apache
FROM php:8.2-apache
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libicu-dev \
git \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd zip intl pdo pdo_mysql mysqli
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Set the working directory in the container
WORKDIR /var/www/html
# Copy composer files and install PHP dependencies
COPY composer.json composer.lock ./
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer install --no-dev --optimize-autoloader
# Copy the rest of the application code
COPY . .
# Remove .env file if it exists
RUN rm -f .env
# Expose port 80
EXPOSE 80
# Start Apache in the foreground
CMD ["apache2-foreground"]