posaune
[timetracker.git] / dockerfile-tt
1 # This file is for development work. Not suitable for production.
2 FROM php:7.2-apache
3
4 # Use the default production configuration.
5 RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
6
7 # Override with custom settings.
8 # COPY config/php_tt.ini $PHP_INI_DIR/conf.d/
9
10 # Install mysqli extension.
11 RUN docker-php-ext-install mysqli
12
13 # Install gd extension.
14 RUN apt-get update && apt-get install libpng-dev -y \
15  && docker-php-ext-install gd
16
17 # Install ldap extension.
18 RUN apt-get install libldap2-dev -y \
19   && docker-php-ext-install ldap
20 # TODO: check if ldap works, as the above is missing this step:
21 # && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
22
23 # Cleanup. The intention was to keep image size down.
24 # RUN rm -rf /var/lib/apt/lists/*
25 #
26 # The above does not work. Files are removed, but
27 # image files (zipped or not) are not getting smaller. Why?
28
29 # Copy application source code to /var/www/html/.
30 COPY . /var/www/html/
31 # Create configuration file.
32 RUN cp /var/www/html/WEB-INF/config.php.dist /var/www/html/WEB-INF/config.php
33 # Replace DSN value to something connectable to a Docker container running mariadb.
34 RUN sed -i "s|mysqli://root:no@localhost/dbname|mysqli://anuko_user:anuko_pw@anuko_db/timetracker|g" /var/www/html/WEB-INF/config.php
35 # Note that db is defined as anuko_db/timetracker where anuko_db is service name and timetracker is db name.
36 # See docker-compose.yml for details.