This pull request adds support for HTTPS into Meican docker image, with automatic redirect from HTTP to HTTPS and using default snakeoil certificate (as provided by packet cert-ssl). I've also added instructions on how to mount volumes on the docker-compose file to use your own certificate.
Also, upon startup the correspondent port will be properly setup:
ubuntu@ubuntu:~/sdx-meican$ docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
[+] Running 5/5
⠿ Network sdx-meican_default Created 0.2s
⠿ Volume "sdx-meican_db-meican" Created 0.0s
⠿ Container meican-db Started 1.4s
⠿ Container meican-phpmyadmin Started 2.7s
⠿ Container meican-app-dev Started 2.7s
ubuntu@ubuntu:~/sdx-meican$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c78c6b1e1935 phpmyadmin/phpmyadmin "/docker-entrypoint.…" 19 minutes ago Up 19 minutes 0.0.0.0:8081->80/tcp, :::8081->80/tcp meican-phpmyadmin
0d92f2195770 meican-app-dev "./docker_for_build/…" 19 minutes ago Up 19 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp meican-app-dev
4c7409dabc42 mysql:5.7 "docker-entrypoint.s…" 19 minutes ago Up 19 minutes 3306/tcp, 33060/tcp meican-db
Finally, the test to validate if it is working:
> curl http://192.168.64.8
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://192.168.64.8/">here</a>.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at 192.168.64.8 Port 80</address>
</body></html>
> curl -L http://192.168.64.8 --insecure | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 307 100 307 0 0 39592 0 --:--:-- --:--:-- --:--:-- 99k
100 4094 100 4094 0 0 82076 0 --:--:-- --:--:-- --:--:-- 82076
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MEICAN - Management Environment of Inter-domain Circuits for Advanced Networks</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-param" content="_csrf">
<meta name="csrf-token" content="RjhXc01rVnAzCjhCCToaAzQODzEvImIXD0kYJgI0IQkSYT8QBhg/XQ==">
Closes N/A
Description of the change
This pull request adds support for HTTPS into Meican docker image, with automatic redirect from HTTP to HTTPS and using default snakeoil certificate (as provided by packet
cert-ssl
). I've also added instructions on how to mount volumes on the docker-compose file to use your own certificate.Local tests
Building the new docker image works as expected:
Also, upon startup the correspondent port will be properly setup:
Finally, the test to validate if it is working: