From 644b343a1bdce10228b3ce7e734424c6d4c3dcc5 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 20 Jan 2025 21:16:46 +0200 Subject: [PATCH] chore: add dev docker compose file --- .gitignore | 4 ++-- docker-compose.dev.yml | 34 ++++++++++++++++++++++++++++++++++ docker-compose.example.yml | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 docker-compose.dev.yml diff --git a/.gitignore b/.gitignore index 61edd90..b879f62 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,8 @@ internal/assets/dist # binaries tinyauth -# dev docker compose -docker-compose.dev.yml +# test docker compose +docker-compose.test.yml # users file users.txt \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..fb3cc44 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,34 @@ +services: + traefik: + container_name: traefik + image: traefik:v3.3 + command: --api.insecure=true --providers.docker + ports: + - 80:80 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + labels: + traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth + + nginx: + container_name: nginx + image: nginx:latest + labels: + traefik.enable: true + traefik.http.routers.nginx.rule: Host(`nginx.dev.local`) + traefik.http.services.nginx.loadbalancer.server.port: 80 + traefik.http.routers.nginx.middlewares: tinyauth + + tinyauth: + container_name: tinyauth + build: + context: . + dockerfile: Dockerfile + environment: + - SECRET=some-random-32-chars-string + - APP_URL=http://tinyauth.dev.local + - USERS=user:$$2a$$10$$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u # user:password + labels: + traefik.enable: true + traefik.http.routers.tinyauth.rule: Host(`tinyauth.dev.local`) + traefik.http.services.tinyauth.loadbalancer.server.port: 3000 diff --git a/docker-compose.example.yml b/docker-compose.example.yml index d3fc1a1..d9a7ddb 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -25,7 +25,7 @@ services: environment: - SECRET=some-random-32-chars-string - APP_URL=https://tinyauth.example.com - - USERS=user:$$2a$$10$$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u + - USERS=user:$$2a$$10$$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u # user:password labels: traefik.enable: true traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`)