-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml.erb
57 lines (53 loc) · 1.85 KB
/
docker-compose.yml.erb
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
<%
# ---------------- Rancher Desktop does not like bind mounts containing symlinks
def realpath(f)
`realpath #{f}`.chomp
end
DEV_DOMAIN=ENV['DEV_DOMAIN'] || 'dev.jkldsa.com'
%>
version: '3'
# This is a generic traefik configuration made for dockerised applications
# For an application to be visible and integrated into this traefik:
# 1. attach it to the "traefik" external network:
# networks:
# - traefik
# networks:
# traefik:
# external: true
#
# 2. attach configuration for traefik as "labels" for the application to be exposed
# labels:
# - "traefik.docker.network=traefik"
# - "traefik.enable=true"
# - "traefik.basic.frontend.rule=Host:app.my-awesome-app.org"
# - "traefik.basic.port=9000"
# - "traefik.basic.protocol=http"
# - "traefik.admin.frontend.rule=Host:admin-app.my-awesome-app.org"
# - "traefik.admin.protocol=https"
# - "traefik.admin.port=9443"
services:
proxy:
container_name: gctraefik
image: traefik:v2.9
command: --api.insecure=true --providers.docker # --configFile=/traefik.yml
ports:
- "80:80" # The HTTP port
- "443:443"
- "9090:9090" # The TCP/TLS Entry Point
networks:
- traefik
volumes:
# mount the docker socket file so that traefik will receive the labels for dynamic configuration
- /var/run/docker.sock:/var/run/docker.sock
- target: /traefik.yml
source: <%= realpath "./traefik.yml" %>
read_only: true
type: bind
- <%= realpath "./certs" %>:/certs
- <%= realpath "./config" %>:/config
- <%= realpath "./logs" %>:/log
# An external network so the same traefik can be use for different project (all sharing ports 80,443)
# This has to be created by hand otherwise the name is not correct
networks:
traefik:
external: true