Delirium Delirium - 3 months ago 14
Apache Configuration Question

Application in docker with https

I have symfony2 application installing in docker container, and I don`t know how to apply my SSL certs+key inside the docker container with apache. I am running Elastic Beanstalc on Amazon with Docker.

Any ideas?

My Dockerfile file setup apache/php:

#prepare php and apache

RUN rm -rf /etc/apache2/sites-available/* /etc/apache2/sites-enabled/*

ENV APP_DOCUMENT_ROOT /var/app/web
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2

ADD docker/php.ini /usr/local/etc/php/
ADD docker/000-default.conf /etc/apache2/sites-available/000-default.conf

WORKDIR /var/app

Answer

Assuming your certs are in docker/certs. You'll need to add the certs into the container, you'll edit your Dockerfile to include the files in the proper destination:

ADD docker/certs/ /etc/apache2/ssl

This tutorial may help you out regarding ssl in apache: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04

Comments