File tree Expand file tree Collapse file tree 5 files changed +29
-23
lines changed Expand file tree Collapse file tree 5 files changed +29
-23
lines changed Original file line number Diff line number Diff line change
1
+ $(shell cp -n dist.env .env)
2
+ include .env
3
+
1
4
install :
2
- cp docker.env .env
3
- docker-compose pull
4
- docker network create dev-router
5
+ docker compose pull
6
+ docker network create $(DEV_ROUTER_NETWORK )
5
7
6
8
run :
7
- docker- compose up -d
9
+ docker compose up -d
8
10
9
11
stop :
10
- docker- compose down
12
+ docker compose down
11
13
12
14
restart : stop run
13
15
Original file line number Diff line number Diff line change 1
1
# Development Router
2
2
3
- Automated Reverse Proxy for local docker services.
4
-
5
- Based on https://github.com/nginx-proxy/nginx-proxy .
3
+ Automated Reverse Proxy and virtual hosts for local docker services.
6
4
7
5
## Usage:
8
6
@@ -13,18 +11,15 @@ make run
13
11
14
12
1 . Add to upstream service docker-compose configuration:
15
13
``` yaml
16
- version : " 3.7"
17
-
18
14
services :
19
15
some-service :
20
- networks :
21
- dev-router :
22
- default :
23
- environment :
24
- - VIRTUAL_HOST=some-service.local
16
+ labels :
17
+ - " traefik.enable=true"
18
+ - " traefik.http.routers.some-service.rule=Host(`some-service.local`)"
19
+ - " traefik.http.routers.some-service.entrypoints=web"
25
20
` ` `
26
21
27
- 2. Add to service domain to ` /etc/hosts`
22
+ 2. Add virtual host name to ` /etc/hosts`
28
23
```
29
24
127.0.0.1 some-service.local
30
25
```
Original file line number Diff line number Diff line change
1
+ HOST_WEB_PORT = 80
2
+ HOST_UI_PORT = 8080
3
+ DEV_ROUTER_NETWORK = dev-router
Original file line number Diff line number Diff line change 1
1
version : " 3.7"
2
2
3
3
services :
4
- nginx-proxy :
5
- image : nginxproxy/nginx-proxy:alpine
4
+ traefik :
5
+ image : traefik:v2.2
6
+ restart : unless-stopped
6
7
container_name : dev-router
7
- restart : always
8
+ command :
9
+ - --api.insecure=true
10
+ - --providers.docker=true
11
+ - --providers.docker.exposedbydefault=false
12
+ - --entrypoints.web.address=:80
8
13
ports :
9
- - ${DEV_ROUTER_HOST_PORT}:80
10
- volumes :
11
- - /var/run/docker.sock:/tmp/docker.sock:ro
14
+ - ${HOST_WEB_PORT}:80
15
+ - ${HOST_UI_PORT}:8080
12
16
networks :
13
17
dev-router :
18
+ volumes :
19
+ - /var/run/docker.sock:/var/run/docker.sock:ro
14
20
15
21
networks :
16
22
dev-router :
23
+ name : ${DEV_ROUTER_NETWORK}
17
24
external : true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments