Skip to content

Commit 0e51846

Browse files
committed
disable error and enable log in apache configuration
1 parent 9ed90ef commit 0e51846

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

infra/docker/.htaccess

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
RewriteEngine On
2+
# The following rule tells Apache that if the requested filename
3+
# exists, simply serve it.
4+
RewriteCond %{REQUEST_FILENAME} -s [OR]
5+
RewriteCond %{REQUEST_FILENAME} -l [OR]
6+
RewriteCond %{REQUEST_FILENAME} -d
7+
RewriteRule ^.*$ - [NC,L]
8+
# The following rewrites all other queries to index.php. The
9+
# condition ensures that if you are using Apache aliases to do
10+
# mass virtual hosting, the base path will be prepended to
11+
# allow proper resolution of the index.php file; it will work
12+
# in non-aliased environments as well, providing a safe, one-size
13+
# fits all solution.
14+
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
15+
RewriteRule ^(.*) - [E=BASE:%1]
16+
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
17+
18+
# supress php errors
19+
php_flag display_startup_errors off
20+
php_flag display_errors off
21+
php_flag html_errors off
22+
23+
# enable PHP error logging
24+
php_flag log_errors on
25+
php_value error_log /var/app/data/logs/error.log

infra/docker/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ RUN ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
55

66
# Install last update and php extension
77
RUN apt-get update && apt-get install -y --no-install-recommends \
8-
git \
98
vim \
109
bzip2 \
1110
zip \
11+
unzip \
1212
libbz2-dev \
1313
libmcrypt-dev \
1414
libicu-dev \
@@ -30,7 +30,11 @@ COPY infra/docker/vhost.conf /etc/apache2/sites-available/000-default.conf
3030
WORKDIR /var/app
3131
COPY . /var/app/
3232

33-
RUN /usr/bin/composer update \
33+
# htaccess specific to docker app
34+
COPY infra/docker/.htaccess public/
35+
36+
# Update project
37+
RUN /usr/bin/composer install --no-dev \
3438
&& ./scripts/post-create-project
3539

3640
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)