1 of 28

2 of 28

3 of 28

VS

4 of 28

5 of 28

6 of 28

7 of 28

8 of 28

9 of 28

10 of 28

11 of 28

12 of 28

version: '3'

services:

main:

image: php:7.2-apache

volumes:

- .:/var/www/html

ports:

- 80:80

13 of 28

version: '3'

services:

main:

image: company/my-image

restart: always

ports:

- 80:80

14 of 28

version: '3'

services:

main:

image: company/my-image

restart: always

networks:

- database

ports:

- 80:80

db:

image: mariadb:latest

restart: always

networks:

- database

environment:

MYSQL_ROOT_PASSWORD: super-secret-password

MYSQL_DATABASE: db_name

volumes:

- ./data:/var/lib/mysql

networks:

database:

15 of 28

16 of 28

17 of 28

version: '3'

services:

traefik:

image: traefik:1.6.1

restart: always

ports:

- 80:80

- 443:443

networks:

- web

volumes:

- /var/run/docker.sock:/var/run/docker.sock

- ./traefik.toml:/traefik.toml

- ./acme.json:/acme.json

container_name: traefik

networks:

web:

external: true

18 of 28

debug = false

logLevel = "INFO"

defaultEntryPoints = ["https","http"]

[traefikLog]

[accessLog]

[entryPoints]

[entryPoints.http]

address = ":80"

[entryPoints.http.redirect]

entryPoint = "https"

[entryPoints.https]

address = ":443"

[entryPoints.https.tls]

[retry]

[docker]

endpoint = "unix:///var/run/docker.sock"

domain = "example.com"

watch = true

exposedbydefault = false

[acme]

email = "jakub.kluvanek@biddingfox.com"

storage = "acme.json"

entryPoint = "https"

OnHostRule = true

[acme.httpChallenge]

entryPoint = "http"

19 of 28

version: '3'

services:

main:

image: nginx

expose:

- 80

networks:

- web

labels:

- "traefik.backend=test"

- "traefik.docker.network=web"

- "traefik.frontend.rule=Host:test.example.com"

- "traefik.enable=true"

- "traefik.port=80"

networks:

web:

external: true

20 of 28

21 of 28

22 of 28

23 of 28

24 of 28

25 of 28

26 of 28

27 of 28

bdfx.cz/es

28 of 28

jakub.kluvanek@biddingfox.com