-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 794 Bytes
/
Dockerfile
File metadata and controls
34 lines (26 loc) · 794 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
# Use the official PHP image with Apache
FROM php:8.1-apache
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
libonig-dev \
curl \
&& docker-php-ext-install pdo pdo_mysql gd mbstring
# Copy Composer and install dependencies
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY . /var/www/html
RUN composer install --no-scripts --no-autoloader && \
composer dump-autoload --optimize
# Set permissions for Laravel
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Enable Apache mod_rewrite for Laravel
RUN a2enmod rewrite
# Expose port 80
EXPOSE 80
CMD ["apache2-foreground"]