deploy-with-https.mo
Last updated
Last updated
If, as an expert of docker, you want to adapt the standard to the context of your project, you have to check that:
Connect to your server ssh user@your.domain
Create a .env
file
Set the NGINX_FILES_PATH=/srv/nginx/data
in the .env
vim ./.env
line 41 replace NGINX_FILES_PATH=/srv/nginx/data
(or a different path if you prefer)
CHECK
Try to launch the companion by running:
You should have the following error because the port 80 is already used by your app docker:
Remove the binding 80 port command, but expose it
Configure the app to use the network created by the companion (webproxy
is the default name)
In your project set 3 environment variable: VIRTUAL_HOST
, LETSENCRYPT_HOST
, LETSENCRYPT_EMAIL
. The email will be used by Letsencrypt to notify you if the certificate expire.There are 2 ways:
In the docker-compose file
In your prod.env file that is read by your Dockerfile.
In the ./env/prod.env
add the following:
OTHER solution
If you have no .env file you an also Update the docker-compose-prod file
BUSINESS INTERRUPTION
You will have to shut down your docker (so the port 80 is available), so during this step your domain won't be accessible.
Cut your app docker:
Start the companion (go to the companion directory):
Launch your project docker again:
CHECK
Clone the nginx-proxy-companion on the server at the root of the server.
Check the validity of your domain, go to
Go and check your domain. Useful tip: go to the Handshake Simulation section and check the supported devices.