-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24c1572
commit 3951411
Showing
6 changed files
with
97 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
FROM nginx:1.26-alpine | ||
FROM traefik:v3.3 | ||
|
||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY ./traefik.yml /etc/traefik/traefik.yml | ||
COPY ./dynamic.yml /etc/traefik-dynamic/dynamic.yml | ||
|
||
EXPOSE 80 | ||
EXPOSE 80 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# HTTP routers, services, and middlewares | ||
http: | ||
routers: | ||
|
||
# Backend subdomain | ||
backend: | ||
rule: HostRegexp(`^backend\..+\..+$`) | ||
entryPoints: | ||
- http | ||
service: app-service | ||
middlewares: | ||
- add-headers | ||
|
||
# Docker Dashboard subdomain | ||
dockerdashboard: | ||
rule: HostRegexp(`^dockerdashboard\..+\..+$`) | ||
entryPoints: | ||
- http | ||
service: docker-dashboard-service | ||
middlewares: | ||
- add-headers | ||
|
||
# MongoDB Dashboard subdomain | ||
mongodashboard: | ||
rule: HostRegexp(`^mongodashboard\..+\..+$`) | ||
entryPoints: | ||
- http | ||
service: mongodb-dashboard-service | ||
middlewares: | ||
- add-headers | ||
|
||
# Catch-all router for unmatched subdomains | ||
catch-all: | ||
rule: HostRegexp(`.+`) | ||
entryPoints: | ||
- http | ||
service: frontend-service | ||
middlewares: | ||
- add-headers | ||
|
||
services: | ||
frontend-service: | ||
loadBalancer: | ||
servers: | ||
- url: "http://frontend:3000" | ||
|
||
app-service: | ||
loadBalancer: | ||
servers: | ||
- url: "http://app:80" | ||
|
||
docker-dashboard-service: | ||
loadBalancer: | ||
servers: | ||
- url: "http://docker_dashboard:9000" | ||
|
||
mongodb-dashboard-service: | ||
loadBalancer: | ||
servers: | ||
- url: "http://mongodb_dashboard:8081" | ||
|
||
middlewares: | ||
# Middleware to add headers to all requests | ||
add-headers: | ||
headers: | ||
customRequestHeaders: | ||
X-Real-IP: "{remote_ip}" | ||
X-Forwarded-For: "{remote_ip}" | ||
X-Forwarded-Proto: "{scheme}" | ||
X-Forwarded-Host: "{host}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Define the entry points to listen on port 80 for HTTP | ||
entryPoints: | ||
http: | ||
address: ":80" # Listen on port 80 for HTTP requests | ||
|
||
# Enable access logs | ||
log: | ||
level: DEBUG | ||
format: common | ||
filePath: "/dev/stdout" # Logs to stdout | ||
|
||
# Enable the Traefik dashboard (optional, for debugging purposes) | ||
api: | ||
insecure: true # Enable insecure dashboard (for local testing, don't use in production) | ||
dashboard: true # Enable the dashboard view | ||
|
||
providers: | ||
file: | ||
directory: /etc/traefik-dynamic |