generate ssl
voir : comment générer mes certificats ssl sur linux avec certbot et ovh.
web container
Je crée les dossiers pour le container web :
sudo mkdir -p /srv/web/nginx/conf /srv/web/nginx/log /srv/web/www-data
Le fichier docker-compose pour le container web : web-docker-compose.yml :
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
49
50
51
52
53
54
55
56
57
58
59
60
61
|
volumes:
nginx_conf:
name: nginx-conf
driver: local
driver_opts:
type: none
o: bind
device: /srv/web/nginx/conf
nginx_log:
name: nginx-log
driver: local
driver_opts:
type: none
o: bind
device: /srv/web/nginx/log
www_data:
name: www-data
driver: local
driver_opts:
type: none
o: bind
device: /srv/web/www-data
www_ssl:
name: www-ssl
driver: local
driver_opts:
type: none
o: bind
device: /etc/letsencrypt
networks:
web_network:
name: web-network
dpaste_network:
name: dpaste-network
external: true
matrix_network:
name: matrix-network
external: true
gitlab_network:
name: gitlab-network
external: true
services:
nginx:
image: nginx:latest
container_name: nginx-container
restart: always
volumes:
- nginx_conf:/etc/nginx
- nginx_log:/var/log/nginx
- www_data:/usr/share/nginx/html
- www_ssl:/etc/letsencrypt
networks:
- web_network
- dpaste_network
- matrix_network
- gitlab_network
ports:
- '80:80'
- '443:443'
|
Je crée le container web :
sudo docker-compose -p web -f ./web-docker-compose.yml up -d