Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade + GitHub actions #4

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: push
name: Tests
jobs:
local-setup:
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: 'Setup Docker'
uses: docker-practice/actions-setup-docker@master
- name: 'Debug versions'
run: |
docker --version
- name: 'Add hosts to /etc/hosts'
run: |
sudo echo "127.0.0.1 reverse-proxy.test" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 hello-world.test" | sudo tee -a /etc/hosts
- name: 'Copy configuration files'
run: cp -r configs-local configs
- name: 'Start reverse proxy with local setup'
run: docker compose -f docker-compose.local.yml up -d --wait
- name: 'Test dashboard'
run: curl http://reverse-proxy.test/dashboard/#/
- name: 'Start hello-world example'
run: cd examples && docker compose -f docker-compose.local.yml up -d
- name: 'Test hello-world'
run: curl http://hello-world.test
5 changes: 5 additions & 0 deletions configs-local/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ entryPoints:
address: ":80"
websecure:
address: ":443"
ping:
address: ":8082"

# Access logs
# accessLog: fields:
Expand All @@ -24,6 +26,9 @@ providers:
directory: /etc/traefik/dynamic
watch: true

ping:
entryPoint: "ping"

api:
dashboard: true

Expand Down
5 changes: 5 additions & 0 deletions configs-prod/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ entryPoints:
address: ":80"
websecure:
address: ":443"
ping:
address: ":8082"

# Access logs
# accessLog: fields:
Expand All @@ -33,6 +35,9 @@ certificatesResolvers:
email: [email protected]
storage: /etc/traefik/acme/acme.json

ping:
entryPoint: "ping"

api:
dashboard: true

Expand Down
8 changes: 7 additions & 1 deletion docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ networks:
- subnet: 10.100.100.0/24
services:
traefik:
image: traefik:2.9.1
image: traefik:2.11.0
restart: always
container_name: reverse_proxy_traefik
ports:
Expand All @@ -18,6 +18,12 @@ services:
- ./certificates:/certs:ro
- ./configs/traefik.yml:/etc/traefik/traefik.yml
- ./configs/dynamic:/etc/traefik/dynamic
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 5s
timeout: 1s
retries: 3
start_period: 10s
networks:
routing:
ipv4_address: 10.100.100.10
8 changes: 7 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ networks:
driver: bridge
services:
traefik:
image: traefik:2.9.1
image: traefik:2.11.0
restart: always
container_name: reverse_proxy_traefik
ports:
Expand All @@ -15,5 +15,11 @@ services:
- ./configs/traefik.yml:/etc/traefik/traefik.yml
- ./configs/dynamic:/etc/traefik/dynamic
- ./certificates/acme.json:/etc/traefik/acme/acme.json
healthcheck:
test: [ "CMD", "traefik", "healthcheck", "--ping" ]
interval: 5s
timeout: 1s
retries: 3
start_period: 10s
networks:
- routing
19 changes: 19 additions & 0 deletions examples/docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3.8'
services:
hello-world:
image: nginx
labels:
- "traefik.enable=true"
- "traefik.docker.network=reverse-proxy-docker-traefik_routing"
- "traefik.http.routers.test.rule=Host(`hello-world.test`)"
- "traefik.http.routers.test.entrypoints=web"
- "traefik.http.services.test.loadbalancer.server.port=80"
- "traefik.http.routers.test-https.rule=Host(`hello-world.test`)"
- "traefik.http.routers.test-https.entrypoints=websecure"
- "traefik.http.routers.test-https.tls=true"
networks:
- reverse-proxy
networks:
reverse-proxy:
name: reverse-proxy-docker-traefik_routing
external: true
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © `2020` `korridor`
Copyright © `2024` `korridor`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
Loading