Bonjour,
Je cherche à utiliser un serveur pour plusieurs applications, et tant qu'a faire, a containeriser celles-ci.
Je me suis donc pencher sur ceci https://github.com/JrCs/docker-letse...roxy-companion qui permet de ne pas ce pré-occuper du certificat SSL. Ceci étant fait, je ne comprend pas comment je route mon traffic depuis ce proxy vers mes autres applications Docker...
J'ai l'impression que c'est assez simple, mais je ne dois pas bien faire quelques choses...
Ma démarche (avec docker-compose) :
Puis je demarre un service :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 version: '3' services: nginx: image: nginx restart: always volumes: - "./etc/nginx/conf.d/:/etc/nginx/conf.d/" - "./nginx/vhost.d:/etc/nginx/vhost.d" - "./nginx/html:/usr/share/nginx/html" - "./nginx/certs:/etc/nginx/certs:ro" labels: com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" environment: VIRTUAL_HOST: monsite.com LETSENCRYPT_HOST: monsite.com LETSENCRYPT_EMAIL: mon-email@email.com ports: - "80:80" - "443:443" nginx-gen: image: jwilder/docker-gen restart: always labels: com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen: "true" volumes: - "./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro" - "/var/run/docker.sock:/tmp/docker.sock:ro" - "./etc/nginx/conf.d/:/etc/nginx/conf.d/" - "./nginx/vhost.d:/etc/nginx/vhost.d" - "./nginx/html:/usr/share/nginx/html" - "./nginx/certs:/etc/nginx/certs:ro" labels: com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen: "true" nginx-letsencrypt: image: jrcs/letsencrypt-nginx-proxy-companion restart: always volumes: - "./etc/nginx/conf.d/:/etc/nginx/conf.d/" - "./nginx/vhost.d:/etc/nginx/vhost.d" - "./nginx/html:/usr/share/nginx/html" - "./nginx/certs:/etc/nginx/certs:ro" - "/var/run/docker.sock:/tmp/docker.sock:ro" depends_on: - nginx-genEn vrai j'aimerais démarrer une application complexe, avec un autre docker compose, mais dans un premier temps, je voulais déjà tester cela...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 sudo docker run -d \ -e "VIRTUAL_HOST=test.monsite.com" \ -e "LETSENCRYPT_HOST=test.monsite.com" \ -e "LETSENCRYPT_EMAIL=mon-email@email.com" \ --expose 80 nginx
Bien à vous
Partager