Re(rerererer)-starting Docker

I had a hell of a time getting a Docker development environment started. I keep trying once a year, as I know that's the modern thing, but each time I find it more trouble than it's worth. If I can just run up an Apache+PHP setup on my machine... why bother with Docker? But... sigh.

I've tried again. For about 3 hours I wrestled with php:7.2-apache, but I've got it to at least Start to work.

  • I'm just copying my directory from my base machine for now. Doesn't fully work, so a build chain will be required.
  • I've put a docker file in my repository. Should make it .docker I suppose.
  • Activating the modules required in apache was trial and error.
  • Finding where the php.ini-development to copy was annoying
  • I'm installing libgnutls26 & libgnutls27 to create a certificate on the box, to prevent any weirdness

Behold, my current Dockerfile.

 1FROM php:7.2-apache
 3# ROOT
 4COPY dist/ /var/www/
 6RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
 7RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
 9ADD ./docker/httpd-ssl.conf /etc/apache2/sites-enabled/000-default.conf
10RUN ln -s /etc/apache2/mods-available/ssl.load  /etc/apache2/mods-enabled/ssl.load
11RUN ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/headers.load
12RUN ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
14RUN mv "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini"
16RUN mkdir -p /etc/apache2/ssl/
17RUN apt-get update; apt-cache policy libgnutls26
18RUN apt-get update; apt-cache policy libgnutls27
19RUN openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj \
20    "<Keyness>" \
21    -keyout /etc/apache2/ssl/ssl.key -out /etc/apache2/ssl/ssl.crt
23RUN mkdir -p /var/run/apache2/
25EXPOSE 443

It's finally accepting connections from my machine on port 443. Failing nastilly, but that's due to the simple copy of code. Now to figure out how to do a deploy onto the box of what I want. Baby steps.

UPDATE: More learnings, to follow the log file: docker service logs arch_risk-management_web -f