Skip to content

Commit c1735e9

Browse files
committed
Adding traefik infrastructure configuration
1 parent 34c6b64 commit c1735e9

File tree

8 files changed

+338
-267
lines changed

8 files changed

+338
-267
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"eslint.options": { "flags": ["unstable_ts_config"] },
32
"eslint.useFlatConfig": true
43
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TypeScript template
22

3-
My opinionated TypeScript template that sets up a project with EsLint, testing, package manager, CI/CD, and more.
3+
My opinionated TypeScript template that sets up a project with EsLint, testing, package manager and CI/CD.
44

55
- Using ESLint's new configuration system - https://eslint.org/docs/latest/use/configure/configuration-files-new
66
- Using Yarn as it simplifies adding arguments when running scripts.
@@ -13,3 +13,5 @@ My opinionated TypeScript template that sets up a project with EsLint, testing,
1313
## npm-check-updates
1414

1515
`npm-check-updates` helps automatically updating the dependencies in the project. Will most likely not be used in a real project because they can be very sensitive to updating dependencies, even minor ones.
16+
17+
## [Traefik infrastructure](./traefik-infrastructure/README.md)

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@
2121
"scripts": {
2222
"build": "tsc",
2323
"dev": "node --loader ts-node/esm src/index.ts",
24-
"lint": "eslint --flag unstable_ts_config .",
24+
"lint": "eslint .",
2525
"start": "node dist/src/index.js",
2626
"test": "yarn lint && yarn ut",
2727
"update-dependencies": "npx npm-check-updates -u && yarn && yarn dedupe",
2828
"ut": "node --experimental-test-coverage --import tsx --test src/**/*.test.ts",
2929
"watch": "tsc -w"
3030
},
3131
"devDependencies": {
32-
"@stylistic/eslint-plugin": "^2.11.0",
33-
"@types/node": "^22.10.1",
34-
"@typescript-eslint/eslint-plugin": "^8.17.0",
35-
"@typescript-eslint/parser": "^8.17.0",
36-
"eslint": "^9.16.0",
32+
"@stylistic/eslint-plugin": "^4.1.0",
33+
"@types/node": "^22.13.5",
34+
"@typescript-eslint/eslint-plugin": "^8.25.0",
35+
"@typescript-eslint/parser": "^8.25.0",
36+
"eslint": "^9.21.0",
3737
"eslint-plugin-simple-import-sort": "^12.1.1",
3838
"eslint-plugin-unused-imports": "^4.1.4",
39-
"jiti": "^2.4.1",
39+
"jiti": "^2.4.2",
4040
"ts-node": "^10.9.2",
41-
"tsx": "^4.19.2",
42-
"typescript": "^5.7.2"
41+
"tsx": "^4.19.3",
42+
"typescript": "^5.7.3"
4343
},
4444
"packageManager": "[email protected]",
4545
"engines": {
4646
"node": ">=23.0.0"
4747
},
4848
"dependencies": {
49-
"solid-js": "^1.9.3"
49+
"solid-js": "^1.9.5"
5050
}
5151
}

traefik-infrastructure/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Traefik infrastructure
2+
3+
https://doc.traefik.io/traefik/ - Traefik is an open-source Application Proxy that makes publishing your services a fun and easy experience. It receives requests on behalf of your system and identifies which components are responsible for handling them, and routes them securely.
4+
5+
## Install
6+
7+
- Create Docker network: `docker network create traefik-network`
8+
- `docker compose up -d`
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
hello-world:
3+
container_name: hello-world
4+
image: crccheck/hello-world
5+
labels:
6+
- traefik.enable=true
7+
- traefik.http.routers.hello-world.entrypoints=web
8+
networks:
9+
- shared-network
10+
restart: unless-stopped
11+
12+
networks:
13+
shared-network:
14+
external: true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
services:
2+
traefik:
3+
container_name: "traefik"
4+
image: "traefik:latest"
5+
networks:
6+
- traefik-network
7+
ports:
8+
- "80:80"
9+
- "443:443"
10+
- "8080:8080"
11+
restart: unless-stopped
12+
volumes:
13+
- "/var/run/docker.sock:/var/run/docker.sock"
14+
- ./traefik.yml:/etc/traefik/traefik.yml:ro
15+
16+
networks:
17+
traefik-network:
18+
external: true

traefik-infrastructure/traefik.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
api:
2+
dashboard: true
3+
insecure: true
4+
entryPoints:
5+
web:
6+
address: ":80"
7+
websecure:
8+
address: ":443"
9+
traefik:
10+
address: ":8080"
11+
global:
12+
checkNewVersion: true
13+
sendAnonymousUsage: false
14+
log:
15+
level: DEBUG
16+
providers:
17+
docker:
18+
endpoint: unix:///var/run/docker.sock
19+
exposedByDefault: false
20+
certificatesResolvers:
21+
letsencrypt:
22+
acme:
23+
24+
storage: acme.json
25+
httpChallenge:
26+
entryPoint: web

0 commit comments

Comments
 (0)