-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-personalised
27 lines (18 loc) · 1.16 KB
/
Dockerfile-personalised
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
FROM binfalse/contao:latest
MAINTAINER martin scharm <https://binfalse.de/contact/>
USER www-data
# install required modules, e.g. we're using metamodels
RUN php -d memory_limit=-1 /composer/composer.phar require metamodels/bundle_all contao-bootstrap/bundle
# clear contao cache to re-read our configuration when a container is spawned
RUN php -q -d memory_limit=-1 /var/www/html/vendor/contao/manager-bundle/bin/contao-console cache:clear --env=prod --no-warmup
# force-enable SSL
# we're running behind a reverse proxy ~> connections come through HTTP and contao 4 doesn't respect the proxy headers...
# best option is apparently to inject the following very early:
# $_SERVER["HTTPS"] = 1;
# see also https://github.com/contao/core-bundle/issues/895#issuecomment-347662604
RUN sed -i.bak 's%/\*%$_SERVER["HTTPS"] = 1;/*%' /var/www/html/web/app.php && rm /var/www/html/web/app.php.bak
# make files public
# the root is now in ~/web... so we need to create a link ~/web/files -> ~/files
RUN mkdir -p /var/www/html/files && ln -s /var/www/html/files /var/www/html/web/files
USER root
VOLUME ["/var/www/html/app/config", "/var/www/html/files", "/var/www/html/templates"]