Skip to content

Commit 704a357

Browse files
committed
Nginx static files management. Docker-compose improvement and Dockerfile improvement (added mysqli driver)
1 parent 414e70f commit 704a357

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

config/nginx/nginx.conf

+6
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ server {
1414
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
1515
fastcgi_param PATH_INFO $fastcgi_path_info;
1616
}
17+
18+
# Static files
19+
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|txt)$ {
20+
access_log off;
21+
expires 30d;
22+
}
1723
}

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
container_name: ${APP_NAME:?err}-php
99
volumes:
1010
- './app:/var/www/html'
11+
depends_on:
12+
- mariadb
1113

1214
nginx:
1315
image: nginx:latest

docker/php.Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ RUN apt-get update && \
44
apt-get install -y git zip
55

66
RUN curl --silent --show-error https://getcomposer.org/installer | php && \
7-
mv composer.phar /usr/local/bin/composer
7+
mv composer.phar /usr/local/bin/composer
8+
9+
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

0 commit comments

Comments
 (0)