Docker Progresss 1/?

I didn't give up this time. Go me.

Below is where I've gotten to in my Joys of Docker. It's building the correct PHP versioned container, pulling down the various repositories and putting them in the correct locations. It's not running the Blog-update to generate the master content yet, getting some conflicts in when the Apache starts or not, so that will need some work. Additionally, I'm going to need to move a bunch of the build stuff out of Docker and into the Robo runner. It makes more sense the Robo runner handle the deployment of the actual code and Docker should just get the environment and initial set up ready for the code runner to execute in. That make sense? Makes sense to me.

As always, suggestions welcome.

FROM php:7.2-apache

RUN apt-get update --yes
RUN apt-get install --yes \
    <All the required modules>

# CONTENTS FROM DOCKER
RUN mkdir /var/www/<launchpad>
COPY [<Keys and the like>, "/var/www/<launchpad>/"]

# ROOT
ENV APACHE_DOCUMENT_ROOT <root>
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
    && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

# APACHE
ADD ./docker/httpd-ssl.conf /etc/apache2/sites-enabled/000-default.conf
RUN ln -s /etc/apache2/mods-available/ssl.load  /etc/apache2/mods-enabled/ssl.load \
    && ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/headers.load \
    && ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load \
# APACHE-SSL
    && mkdir -p /etc/apache2/ssl/ \
    && apt-get update; apt-cache policy libgnutls26 \
    && apt-get update; apt-cache policy libgnutls27 \
    && openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj \
    "<Keyness>" \
    -keyout /etc/apache2/ssl/ssl.key -out /etc/apache2/ssl/ssl.crt \
    && mkdir -p /var/run/apache2/
EXPOSE 443

# PHP
RUN mv "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
    && docker-php-ext-install gd \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
# COMPOSER    
RUN chmod u+x /var/www/copy/install-composer.sh \
    && /var/www/copy/install-composer.sh \
    && mv composer.phar /usr/local/bin \
    && chmod u+x /usr/local/bin/composer.phar \
    && touch /root/.composer/composer.json \ 
    && echo '<composer stuff>' > /root/.composer/composer.json \
    && composer.phar global update

# CODE
# -- Some of this should be replaced with the Robo Build script
# -- SSH KEYS
RUN <.ssh-keystuff> \
    && <ssh-keygen>
# -- CLONE FROM BITBUCKET: Base App  
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
RUN <git clone> \
    && composer.phar install \
    && <chmod + lns> \
# -- BUILD: Base App
# -- CLONE FROM GITHUB: Blog Generator
# -- CLONE FROM BITBUCKET: Blog Entries
COPY ./docker/config-test.json /var/www/<config-spot>

# FINALLY
RUN <blog-generator!>