diff --git a/Makefile b/Makefile index 329075e..83b8a7c 100644 --- a/Makefile +++ b/Makefile @@ -26,13 +26,10 @@ audit: .PHONY: build build: cd web && pnpm install && pnpm run build - go build $(LDFLAGS) -o $(BIN) main.go && upx $(BIN) - -build-fast: go build $(LDFLAGS) -o $(BIN) main.go .PHONY: docker -docker: +docker: build docker build \ --label "org.opencontainers.image.vendor=Mizuchi Labs" \ --label "org.opencontainers.image.source=https://github.com/MizuchiLabs/mantrae" \ diff --git a/README.md b/README.md index 1f7160b..76f79b6 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ 1. **Access the Web UI**: Open your web browser and navigate to `http://localhost:3000` +1. Or use docker `docker run -p 3000:3000 ghcr.io/mizuchilabs/mantrae:latest` + +1. You can also use the example docker-compose.yml file to run mantrae and traefik together + +1. Use the admin password, which will be printed in the logs after the first start + ## Usage ### Managing Routers diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..c0eb142 --- /dev/null +++ b/compose.yml @@ -0,0 +1,48 @@ +# Example docker-compose.yml file for mantrae +# Check the mantrae logs after first start for the admin password +services: + mantrae: + image: ghcr.io/MizuchiLabs/mantrae:latest + container_name: mantrae + ports: + - 3000:3000 + networks: + - proxy + restart: always + + traefik: + image: docker.io/traefik:latest + container_name: traefik + ports: + - 80:80 + - 443:443 + - 8080:8080 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./traefik:/etc/traefik + networks: + - proxy + command: + - --log.level=INFO + - --api.dashboard=true + - --api.insecure=true # Remove me later + - --entrypoints.web.address=:80 + - --entrypoints.web.http.redirections.entryPoint.to=websecure + - --entrypoints.web.http.redirections.entryPoint.scheme=https + - --entrypoints.websecure.address=:443 + - --entrypoints.websecure.asDefault=true + - --serversTransport.insecureSkipVerify=true + - --providers.docker=true + - --providers.docker.exposedByDefault=false + - --providers.docker.watch=true + - --providers.http=true + - --providers.http.endpoint=http://mantrae:3000 + labels: + - traefik.enable=true + - traefik.http.routers.dashboard.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`) + - traefik.http.routers.dashboard.service=api@internal + - traefik.http.routers.dashboard.entrypoints=websecure + restart: always + +networks: + proxy: