create ssl cer in container to serve content

This commit is contained in:
GotPPay
2018-07-05 18:44:41 +02:00
parent 72d474a985
commit 4346299a52
5 changed files with 153 additions and 11 deletions

View File

@@ -1,11 +1,20 @@
FROM php:7.0-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli
RUN a2enmod rewrite
RUN a2enmod rewrite ssl
COPY docker/php/apache2.conf /etc/apache2/
COPY backend /var/www/html
COPY docker/apache/apache2.conf /etc/apache2/
COPY docker/apache/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf
COPY backend /var/www/html
COPY docker/php/.htaccess /var/www/html/
RUN chown -R www-data:www-data /var/www/html
RUN chown -R www-data:www-data /var/www/html
RUN openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \
-subj "/C=BA/ST=FBiH/L=Sarajevo/O=Saburly/CN=localhost" \
-keyout /etc/ssl/private/selfsigned.key -out /etc/ssl/certs/selfsigned.crt
WORKDIR /etc/apache2/sites-enabled
RUN ln -s ../sites-available/default-ssl.conf default-ssl.conf