Having pushed to DockerHub and successfully tagged a image, I can create remotly a docker container on a Digital Ocean droplet. That's good, but since I host more than one website on this IP, I use the NginX server. My goal is, having example.com nginx config, to set up and deploy the docker container into this website (example.com) with the Engine-X.
docker stack deploy -c ~/etc/example.com/docker-compose.yml example.com
I tried to specify the path, also creating the docker based on the NGINX image, but nothing actually worked for me.
My nginx example.com config:
server {
root /etc/example.com/docker-compose.yml (???);
index index.html index.htm index.nginx-debian.html; (??)
server_name example.com www.example.com;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/bratac.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/bratac.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 404; # managed by Certbot
}
Any thoughts would be appreciated, I really dont know what to do next, researched deep in the net..
Best Regards