Skip to content

Commit 5850101

Browse files
committed
chore(docker): add example docker compose
1 parent 5b72cab commit 5850101

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,10 @@ dotnet Buzzard.dll --urls "https://+:443;http://+:80"
168168
# Exec on project root directory
169169
$ docker build --progress=plain -f docker/Dockerfile .
170170
```
171+
172+
### Release build example with docker
173+
174+
```
175+
$ cd docker/examples
176+
$ docker compose up
177+
```

docker/examples/appsettings.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning",
6+
"Yarp": "Warning"
7+
}
8+
},
9+
"AllowedHosts": "*",
10+
"ReverseProxy": {
11+
"Routes": {
12+
"localhost1": {
13+
"ClusterId": "localhost1",
14+
"Match": {
15+
"Hosts": ["localhost:5134"]
16+
}
17+
},
18+
"localhost2": {
19+
"ClusterId": "localhost2",
20+
"Match": {
21+
"Hosts": ["localhost:5135"]
22+
}
23+
}
24+
},
25+
"Clusters": {
26+
"localhost1": {
27+
"Destinations": {
28+
"front": {
29+
"Address": "http://host.docker.internal:3000/"
30+
}
31+
}
32+
},
33+
"localhost2": {
34+
"Destinations": {
35+
"backend": {
36+
"Address": "http://host.docker.internal:9001/"
37+
}
38+
}
39+
}
40+
}
41+
},
42+
"Firewall": {
43+
"Path": {
44+
"Allow": {
45+
"Contains": [
46+
"/status"
47+
],
48+
"StartsWith": [
49+
"/api/public"
50+
],
51+
"EndsWith": [
52+
".css",
53+
".js",
54+
".png",
55+
".ico"
56+
]
57+
},
58+
"Deny": {
59+
"Contains": [
60+
"/admin",
61+
"/config",
62+
".git",
63+
"../",
64+
"/.env"
65+
],
66+
"StartsWith": [
67+
"/private/"
68+
],
69+
"EndsWith": [
70+
".bak",
71+
".tmp",
72+
".log"
73+
]
74+
}
75+
},
76+
"UserAgent": {
77+
"Deny": {
78+
"Contains": [
79+
"bot"
80+
],
81+
"StartsWith": [
82+
"evil/"
83+
],
84+
"EndsWith": [
85+
"bad"
86+
]
87+
}
88+
}
89+
}
90+
}

docker/examples/compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
buzzard:
3+
build:
4+
context: ../..
5+
dockerfile: docker/Dockerfile
6+
environment:
7+
ASPNETCORE_URLS: "http://+:5134;http://+:5135"
8+
ASPNETCORE_ENVIRONMENT: Production
9+
ports:
10+
- "5134:5134"
11+
- "5135:5135"
12+
volumes:
13+
- ./appsettings.json:/usr/opt/buzzard/appsettings.json
14+
# NOTE: if you want to override `appsettins.json`. Please add `appsettings.Production.json`.
15+
#- ./appsettings.Production.json:/usr/opt/buzzard/appsettings.Production.json
16+
- ./logs:/usr/opt/buzzard/logs
17+
# NOTE: only Linux
18+
#network_mode: host
19+
networks:
20+
buzzard:

0 commit comments

Comments
 (0)