-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (39 loc) · 1.37 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
39
40
41
42
43
44
45
46
47
48
49
50
# Use the official PHP 8.1 Apache image as the base image
FROM php:8.1-apache
# Set the working directory in the container (Contains the composer.json file)
WORKDIR /var/www/html/
# Enable Apache modules
RUN a2enmod rewrite
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y \
zip \
unzip \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libicu-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure intl \
&& docker-php-ext-install gd pdo pdo_mysql mbstring exif pcntl bcmath xml zip intl mysqli
# Install Composer (PHP package manager)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy the application files to the container
COPY . /var/www/html/
# Install dependencies using Composer
RUN composer install
# Laravel ################################
# Generate application key
ADD .env.example .env
RUN php artisan key:generate
# Misc. ##################################
# Expose port 80 to access the web server
# EXPOSE 80
# Install Vim (editor)
RUN apt install vim -y
# Setting file permissions to run Laravel
RUN chown -R www-data:www-data /var/www/html/
# RUN chmod +x /var/www/html/entrypoint/script.sh
# ENTRYPOINT ["/var/www/html/entrypoint/script.sh"]