-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·43 lines (33 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
executable file
·43 lines (33 loc) · 1.09 KB
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
FROM php:8.0-apache
RUN a2enmod rewrite
RUN apt-get update && apt-get install -y \
ca-certificates \
zlib1g-dev \
libpng-dev \
libzip-dev \
git \
unzip \
zip \
software-properties-common \
npm \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install \
bcmath \
exif \
gd \
mysqli \
pdo \
pdo_mysql \
zip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY composer.json composer.lock ./
RUN /usr/local/bin/composer install --no-scripts --no-autoloader
RUN /usr/local/bin/composer dump-autoload --optimize
RUN npm install -g npm@latest n nodemon browser-sync
RUN n latest
COPY . /var/www/html/
RUN chown -R www-data:www-data /var/www/html && \
chmod -R 755 /var/www/html
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
CMD sh -c "nodemon --exec 'apache2-foreground' & browser-sync start --proxy 'localhost:80' --files '**/*.php' --files '**/*.html' --files '**/*.js'"