diff --git a/docs/installation/docker.md b/docs/installation/docker.md index ab5eb28..9324834 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -107,4 +107,32 @@ The last step is to start the scheduler : $ docker-compose up -d celery_beat ``` -You can now use OpenCVE with your own dockerized instance of it. \ No newline at end of file +You can now use OpenCVE with your own dockerized instance of it. + +## Enable SSL ## + +Create a certificate (example for a self-signed certificate) and save it to the conf directory. +``` +$ openssl req -newkey rsa:2048 -nodes -keyout ./conf/domain.key -x509 -days 365 -out ./conf/domain.crt +``` + +Modify the docker-compose.yml and add the following after `- ${OPENCVE_CONFIG_PATH}:/app/opencve.cfg:ro` +``` + - ${OPENCVE_SSL_CRT}:/app/domain.crt:ro + - ${OPENCVE_SSL_KEY}:/app/domain.key:ro +``` + +As a second step change `webserver -b 0.0.0.0:8000` command to +``` +webserver -b 0.0.0.0:8000 --certfile=/app/domain.crt --keyfile=/app/domain.key +``` +Modify the .env file +``` +$ echo 'OPENCVE_SSL_CRT=./conf/domain.crt' >> .env +$ echo 'OPENCVE_SSL_KEY=./conf/domain.key' >> .env +``` +Restart the container +``` +$ docker-compose down +$ docker-compose up -d +```