-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·43 lines (31 loc) · 905 Bytes
/
Dockerfile
File metadata and controls
executable file
·43 lines (31 loc) · 905 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
35
36
37
38
39
40
41
42
43
# Base image
FROM php:8.1-apache
# Set working directory
WORKDIR /var/www/html
# Install dependencies
RUN apt-get update && apt-get install -y \
zip \
unzip \
libonig-dev \
libxml2-dev \
libzip-dev
# Enable required Apache modules
RUN a2enmod rewrite
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath xml zip
# Copy the project files to the container
COPY . .
# Set file permissions
RUN chown -R www-data:www-data storage bootstrap/cache
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install project dependencies
RUN composer install --optimize-autoloader --no-dev
# Generate application key
RUN php artisan key:generate
# Clear configuration cache
RUN php artisan config:cache
# Expose port 80
EXPOSE 80
# Start Apache server
CMD ["apache2-foreground"]