-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (22 loc) · 1.1 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
FROM php:8.1-apache
WORKDIR /app
RUN apt update
RUN apt install -y git default-mysql-client libzip-dev zip libpng-dev libjpeg-dev && \
docker-php-ext-install zip mysqli pdo pdo_mysql && \
docker-php-ext-enable pdo_mysql && \
docker-php-ext-configure gd --with-jpeg && \
docker-php-ext-install -j$(nproc) gd
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN a2enmod rewrite
RUN rm -rf /var/www/html && \
ln -s /app/public /var/www/html
RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN echo "xdebug.mode=off" | tee -a /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini > /dev/null && \
echo "xdebug.start_with_request=yes" | tee -a /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini > /dev/null && \
echo "xdebug.client_host=host.docker.internal" | tee -a /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini > /dev/null
COPY . .
RUN composer install
# Make storage folder and give access to www-data
RUN mkdir -p /app/storage && \
chmod -R ugo+rw /app/storage && \
chown -R www-data:www-data /app/storage