File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM debian AS cert
2+
3+ WORKDIR /kool/ssl
4+
5+ RUN apt-get update && \
6+ apt-get install -y openssl && \
7+ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \
8+ openssl rsa -passin pass:x -in server.pass.key -out _.localhost.key && \
9+ rm server.pass.key && \
10+ openssl req -new -key _.localhost.key -out server.csr \
11+ -subj "/C=XX/ST=XX/L=XX/O=Kool-Local/OU=Localhost/CN=*.localhost" && \
12+ openssl x509 -req -days 365 -in server.csr -signkey _.localhost.key -out _.localhost.crt && \
13+ openssl x509 -in _.localhost.crt -out _.localhost.pem
14+
115FROM kooldev/php:7.1-prod
216
317ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
418 NGINX_LISTEN=80 \
19+ NGINX_HTTPS=false \
20+ NGINX_LISTEN_HTTPS=443 \
21+ NGINX_HTTPS_CERT=/kool/ssl/_.localhost.pem \
22+ NGINX_HTTPS_CERT_KEY=/kool/ssl/_.localhost.key \
523 NGINX_ROOT=/app/public \
624 NGINX_INDEX=index.php \
725 NGINX_CLIENT_MAX_BODY_SIZE=25M \
@@ -36,6 +54,7 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
3654COPY supervisor.conf /kool/supervisor.conf
3755COPY default.tmpl /kool/default.tmpl
3856COPY entrypoint /kool/entrypoint
57+ COPY --from=cert /kool/ssl /kool/ssl
3958RUN chmod +x /kool/entrypoint
4059
4160EXPOSE 80
Original file line number Diff line number Diff line change 11server {
22 listen {{ .Env.NGINX_LISTEN }} default_server;
33 server_name _;
4+ {{ if isTrue .Env.NGINX_HTTPS }}
5+ listen {{ .Env.NGINX_LISTEN_HTTPS }} ssl http2;
6+ ssl_certificate {{ .Env.NGINX_HTTPS_CERT }};
7+ ssl_certificate_key {{ .Env.NGINX_HTTPS_CERT_KEY }};
8+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
9+ ssl_ciphers HIGH:!aNULL:!MD5;
10+ {{ end }}
411 root {{ .Env.NGINX_ROOT }};
512 index {{ .Env.NGINX_INDEX }};
613 charset utf-8;
Original file line number Diff line number Diff line change 1+ FROM debian AS cert
2+
3+ WORKDIR /kool/ssl
4+
5+ RUN apt-get update && \
6+ apt-get install -y openssl && \
7+ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \
8+ openssl rsa -passin pass:x -in server.pass.key -out _.localhost.key && \
9+ rm server.pass.key && \
10+ openssl req -new -key _.localhost.key -out server.csr \
11+ -subj "/C=XX/ST=XX/L=XX/O=Kool-Local/OU=Localhost/CN=*.localhost" && \
12+ openssl x509 -req -days 365 -in server.csr -signkey _.localhost.key -out _.localhost.crt && \
13+ openssl x509 -in _.localhost.crt -out _.localhost.pem
14+
115FROM kooldev/php:7.1
216
317ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
418 NGINX_LISTEN=80 \
19+ NGINX_HTTPS=false \
20+ NGINX_LISTEN_HTTPS=443 \
21+ NGINX_HTTPS_CERT=/kool/ssl/_.localhost.pem \
22+ NGINX_HTTPS_CERT_KEY=/kool/ssl/_.localhost.key \
523 NGINX_ROOT=/app/public \
624 NGINX_INDEX=index.php \
725 NGINX_CLIENT_MAX_BODY_SIZE=25M \
@@ -36,6 +54,7 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
3654COPY supervisor.conf /kool/supervisor.conf
3755COPY default.tmpl /kool/default.tmpl
3856COPY entrypoint /kool/entrypoint
57+ COPY --from=cert /kool/ssl /kool/ssl
3958RUN chmod +x /kool/entrypoint
4059
4160EXPOSE 80
Original file line number Diff line number Diff line change 11server {
22 listen {{ .Env.NGINX_LISTEN }} default_server;
33 server_name _;
4+ {{ if isTrue .Env.NGINX_HTTPS }}
5+ listen {{ .Env.NGINX_LISTEN_HTTPS }} ssl http2;
6+ ssl_certificate {{ .Env.NGINX_HTTPS_CERT }};
7+ ssl_certificate_key {{ .Env.NGINX_HTTPS_CERT_KEY }};
8+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
9+ ssl_ciphers HIGH:!aNULL:!MD5;
10+ {{ end }}
411 root {{ .Env.NGINX_ROOT }};
512 index {{ .Env.NGINX_INDEX }};
613 charset utf-8;
Original file line number Diff line number Diff line change 1+ FROM debian AS cert
2+
3+ WORKDIR /kool/ssl
4+
5+ RUN apt-get update && \
6+ apt-get install -y openssl && \
7+ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \
8+ openssl rsa -passin pass:x -in server.pass.key -out _.localhost.key && \
9+ rm server.pass.key && \
10+ openssl req -new -key _.localhost.key -out server.csr \
11+ -subj "/C=XX/ST=XX/L=XX/O=Kool-Local/OU=Localhost/CN=*.localhost" && \
12+ openssl x509 -req -days 365 -in server.csr -signkey _.localhost.key -out _.localhost.crt && \
13+ openssl x509 -in _.localhost.crt -out _.localhost.pem
14+
115FROM kooldev/php:7.2-prod
216
317ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
418 NGINX_LISTEN=80 \
19+ NGINX_HTTPS=false \
20+ NGINX_LISTEN_HTTPS=443 \
21+ NGINX_HTTPS_CERT=/kool/ssl/_.localhost.pem \
22+ NGINX_HTTPS_CERT_KEY=/kool/ssl/_.localhost.key \
523 NGINX_ROOT=/app/public \
624 NGINX_INDEX=index.php \
725 NGINX_CLIENT_MAX_BODY_SIZE=25M \
@@ -36,6 +54,7 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
3654COPY supervisor.conf /kool/supervisor.conf
3755COPY default.tmpl /kool/default.tmpl
3856COPY entrypoint /kool/entrypoint
57+ COPY --from=cert /kool/ssl /kool/ssl
3958RUN chmod +x /kool/entrypoint
4059
4160EXPOSE 80
Original file line number Diff line number Diff line change 11server {
22 listen {{ .Env.NGINX_LISTEN }} default_server;
33 server_name _;
4+ {{ if isTrue .Env.NGINX_HTTPS }}
5+ listen {{ .Env.NGINX_LISTEN_HTTPS }} ssl http2;
6+ ssl_certificate {{ .Env.NGINX_HTTPS_CERT }};
7+ ssl_certificate_key {{ .Env.NGINX_HTTPS_CERT_KEY }};
8+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
9+ ssl_ciphers HIGH:!aNULL:!MD5;
10+ {{ end }}
411 root {{ .Env.NGINX_ROOT }};
512 index {{ .Env.NGINX_INDEX }};
613 charset utf-8;
Original file line number Diff line number Diff line change 1+ FROM debian AS cert
2+
3+ WORKDIR /kool/ssl
4+
5+ RUN apt-get update && \
6+ apt-get install -y openssl && \
7+ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \
8+ openssl rsa -passin pass:x -in server.pass.key -out _.localhost.key && \
9+ rm server.pass.key && \
10+ openssl req -new -key _.localhost.key -out server.csr \
11+ -subj "/C=XX/ST=XX/L=XX/O=Kool-Local/OU=Localhost/CN=*.localhost" && \
12+ openssl x509 -req -days 365 -in server.csr -signkey _.localhost.key -out _.localhost.crt && \
13+ openssl x509 -in _.localhost.crt -out _.localhost.pem
14+
115FROM kooldev/php:7.2
216
317ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
418 NGINX_LISTEN=80 \
19+ NGINX_HTTPS=false \
20+ NGINX_LISTEN_HTTPS=443 \
21+ NGINX_HTTPS_CERT=/kool/ssl/_.localhost.pem \
22+ NGINX_HTTPS_CERT_KEY=/kool/ssl/_.localhost.key \
523 NGINX_ROOT=/app/public \
624 NGINX_INDEX=index.php \
725 NGINX_CLIENT_MAX_BODY_SIZE=25M \
@@ -36,6 +54,7 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
3654COPY supervisor.conf /kool/supervisor.conf
3755COPY default.tmpl /kool/default.tmpl
3856COPY entrypoint /kool/entrypoint
57+ COPY --from=cert /kool/ssl /kool/ssl
3958RUN chmod +x /kool/entrypoint
4059
4160EXPOSE 80
Original file line number Diff line number Diff line change 11server {
22 listen {{ .Env.NGINX_LISTEN }} default_server;
33 server_name _;
4+ {{ if isTrue .Env.NGINX_HTTPS }}
5+ listen {{ .Env.NGINX_LISTEN_HTTPS }} ssl http2;
6+ ssl_certificate {{ .Env.NGINX_HTTPS_CERT }};
7+ ssl_certificate_key {{ .Env.NGINX_HTTPS_CERT_KEY }};
8+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
9+ ssl_ciphers HIGH:!aNULL:!MD5;
10+ {{ end }}
411 root {{ .Env.NGINX_ROOT }};
512 index {{ .Env.NGINX_INDEX }};
613 charset utf-8;
Original file line number Diff line number Diff line change 1+ FROM debian AS cert
2+
3+ WORKDIR /kool/ssl
4+
5+ RUN apt-get update && \
6+ apt-get install -y openssl && \
7+ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \
8+ openssl rsa -passin pass:x -in server.pass.key -out _.localhost.key && \
9+ rm server.pass.key && \
10+ openssl req -new -key _.localhost.key -out server.csr \
11+ -subj "/C=XX/ST=XX/L=XX/O=Kool-Local/OU=Localhost/CN=*.localhost" && \
12+ openssl x509 -req -days 365 -in server.csr -signkey _.localhost.key -out _.localhost.crt && \
13+ openssl x509 -in _.localhost.crt -out _.localhost.pem
14+
115FROM kooldev/php:7.3-prod
216
317ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
418 NGINX_LISTEN=80 \
19+ NGINX_HTTPS=false \
20+ NGINX_LISTEN_HTTPS=443 \
21+ NGINX_HTTPS_CERT=/kool/ssl/_.localhost.pem \
22+ NGINX_HTTPS_CERT_KEY=/kool/ssl/_.localhost.key \
523 NGINX_ROOT=/app/public \
624 NGINX_INDEX=index.php \
725 NGINX_CLIENT_MAX_BODY_SIZE=25M \
@@ -36,6 +54,7 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
3654COPY supervisor.conf /kool/supervisor.conf
3755COPY default.tmpl /kool/default.tmpl
3856COPY entrypoint /kool/entrypoint
57+ COPY --from=cert /kool/ssl /kool/ssl
3958RUN chmod +x /kool/entrypoint
4059
4160EXPOSE 80
Original file line number Diff line number Diff line change 11server {
22 listen {{ .Env.NGINX_LISTEN }} default_server;
33 server_name _;
4+ {{ if isTrue .Env.NGINX_HTTPS }}
5+ listen {{ .Env.NGINX_LISTEN_HTTPS }} ssl http2;
6+ ssl_certificate {{ .Env.NGINX_HTTPS_CERT }};
7+ ssl_certificate_key {{ .Env.NGINX_HTTPS_CERT_KEY }};
8+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
9+ ssl_ciphers HIGH:!aNULL:!MD5;
10+ {{ end }}
411 root {{ .Env.NGINX_ROOT }};
512 index {{ .Env.NGINX_INDEX }};
613 charset utf-8;
You can’t perform that action at this time.
0 commit comments