-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
98 lines (85 loc) · 3.34 KB
/
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
version: "3.3"
services:
db:
image: mysql:5.7
container_name: database_wp
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} #Check .env file # |
MYSQL_DATABASE: wordpress #Your database # |
MYSQL_USER: wordpress #Your username # | <-- You can change it but, replicate data below
MYSQL_PASSWORD: PasswordMysql #Your Password # |
networks:
- wp
- proxy
labels:
- "traefik.enable=false"
wordpress:
image: wordpress:latest
container_name: wordpress_site
restart: always
volumes:
- ./wordpress/:/var/www/html
# - ./php.ini:/usr/local/etc/php/php-production.ini
# - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress #YOUR username define higher
WORDPRESS_DB_PASSWORD: PasswordMysql #YOUR password define higher
networks:
- proxy
- wp
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:mywebsite.com" # Your url site : ex : mywebsite.com <-- Change it !
- "traefik.frontrend.entryPoints=http,https" # EntryPoints http,https
- "traefik.docker.networks=proxy" # Network traefik
- "traefik.frontend.headers.forceSTSHeader=true" #########################################
- "traefik.frontend.headers.STSSeconds=315360000" # #
- "traefik.frontend.headers.STSIncludeSubdomains=true" # #
- "traefik.frontend.headers.STSPreload=true" # Security of traefik #
- "traefik.frontend.headers.browserXSSFilter=true" # #
- "traefik.frontend.headers.contentTypeNosniff=true" # #
- "traefik.frontend.headers.customFrameOptionsValue=SAMEORIGIN" #########################################
#################################################################################################################
# TRAEFIK CONFIGURATION #
# https://nofreedisk.space/2018/09/15/how-to-make-a-dns-record-with-ovh-and-traefik/ #
#################################################################################################################
traefik:
image: traefik:1.7
container_name: traefik
restart: always
volumes:
- ./trafik/toml/traefik.toml:/etc/traefik/traefik.toml:ro
- ./traefik/acme/:/etc/traefik/acme/
- ./traefik/log/traefik.log:/etc/traefik/traefik.log
- ./traefik/log/access.log:/etc/traefik/access.log
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- "80:80"
- "443:443"
- "8080:8080"
labels:
- traefik.enable=true
- traefik.frontend.entryPoints=http,https
- traefik.frontend.passHostHeader=true
- traefik.frontend.rule=stats.mywebsite.com #It's traefik dashboard access on https. Change it with what you want !
- traefik.port=8080
- traefik.docker.network=proxy
environment:
- OVH_ENDPOINT=ovh-eu
- OVH_APPLICATION_KEY= # Your application key received by ovh api
- OVH_APPLICATION_SECRET= # Your application secret received by ovh api
- OVH_CONSUMER_KEY= # Your consumer key received by ovh api
networks:
- proxy
- wp
volumes:
db_data:
networks:
proxy:
external: true
wp: