Commit bf9846e3 authored by Julien Tant's avatar Julien Tant Committed by Nicolas Widart

add https to app docker image (#354)

parent 55c60b20
......@@ -6,6 +6,7 @@ services:
image: asgardcms/app:latest
ports:
- 80:80
- 443:443
volumes:
- .:/var/www/html:cached
networks:
......
......@@ -41,7 +41,20 @@ COPY default /etc/nginx/sites-enabled/default
COPY php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir /tmp/certgen
WORKDIR /tmp/certgen
RUN openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 \
&& openssl rsa -passin pass:x -in server.pass.key -out server.key \
&& rm server.pass.key \
&& openssl req -new -key server.key -out server.csr -subj "/CN=asgardcms.com" \
&& openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt \
&& cp server.crt /etc/ssl/certs/ \
&& cp server.key /etc/ssl/private/ \
&& rm -rf /tmp/certgen
EXPOSE 80
EXPOSE 443
CMD ["supervisord"]
\ No newline at end of file
......@@ -2,9 +2,14 @@ server {
error_log /dev/stdout info;
access_log /dev/stdout;
listen 80 default_server;
listen 80;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
root /var/www/html/public;
index index.php index.html index.htm;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment