Skip to content

Commit fd5d019

Browse files
committed
fix docker file
1 parent 29b3534 commit fd5d019

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Dockerfile

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
# Use the official PHP lightweight image with Apache
1+
# Use the official PHP image with Apache
22
FROM php:8.3-apache-bullseye
33

44
# Set working directory
55
WORKDIR /var/www/html
66

7-
# Install system dependencies for Laravel (GD, MySQL, etc.)
7+
# Install system dependencies
88
RUN apt-get update && apt-get install -y \
9+
git \
10+
zip \
11+
unzip \
912
libpng-dev \
1013
libjpeg-dev \
1114
libfreetype6-dev \
1215
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
1316
&& docker-php-ext-install gd \
14-
&& docker-php-ext-install pdo pdo_mysql \
15-
&& apt-get clean
17+
&& docker-php-ext-install pdo pdo_mysql
1618

17-
# Enable mod_rewrite for Apache (required for Laravel's clean URLs)
19+
# Enable Apache mod_rewrite
1820
RUN a2enmod rewrite
1921

20-
# Configure Apache to allow overrides and access to the Laravel public directory
22+
# Copy Apache configuration (if you have a custom one)
2123
COPY ./apache/000-default.conf /etc/apache2/sites-available/000-default.conf
2224

23-
# Set correct permissions for the Laravel files
24-
RUN chown -R www-data:www-data /var/www/html
25-
RUN chmod -R 755 /var/www/html
26-
27-
# Copy the project files into the container
28-
COPY . .
29-
3025
# Install Composer
3126
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
3227

33-
# Install PHP dependencies using Composer
28+
# Copy project files
29+
COPY . .
30+
31+
# Install PHP dependencies
3432
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
3533

36-
# Expose port 80 for the Apache server
34+
# Expose port 80
3735
EXPOSE 80
3836

39-
# Set the command to start Apache in the foreground
37+
# Start Apache
4038
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)