diff --git a/README.md b/README.md deleted file mode 100644 index 29d0da2..0000000 --- a/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# traefik-template -Traefik template for developing locally - -## Setup -Clone the repo locally and change into /traefik-template -Here is what the docker-compose file looks like. -``` -version: '3' - -services: - traefik: - image: traefik:v1.7 - command: --api --docker - ports: - - 8080:8080 - volumes: - - /var/run/docker.sock:/var/run/docker.sock - nginx: - image: nginx:latest - ports: - - 80:80 - influxdb: - image: quay.io/influxdb/influxdb:2.0.0-alpha - ports: - - 9999:9999 -``` -## Traefik.toml -``` -[docker] -endpoint = "unix:///var/run/docker.sock" -domain = "localhost" -watch = true -exposedByDefault = true -usebindportip = true -swarmMode = false -network = "web" -[api] -dashboard = true -entryPoint = "traefik" -debug = true -``` -This configuration is a basic setup to expose the dashboard. -Check it out. - -## Compose up -Run the command: -`docker-compose up` to watch the logs -or -`docker-compose up -d` for it to run in the background. - -## Services -1. The dashboard is running at http://localhost:8080 -2. Nginx is running on the main domain http://localhost -3. InfluxDB 2.0 is running on http://influx.localhost:9999 which it should automatically pull up port 9999 - -## Template -This is a template where anyone can build upon this. The next step is to configure ssl. (More to come) diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index eb5b5c9..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: '3' - -services: - traefik: - image: traefik:v1.7 - command: --api --docker - ports: - - 8080:8080 - volumes: - - /var/run/docker.sock:/var/run/docker.sock - nginx: - image: nginx:latest - ports: - - 80:80 - influxdb: - image: quay.io/influxdb/influxdb:2.0.0-alpha - ports: - - 9999:9999 - labels: - - "traefik.enable=true" - - "traefik.frontend.rule=Host:influx.localhost" \ No newline at end of file diff --git a/template2/Readme.md b/template2/Readme.md new file mode 100644 index 0000000..18fb245 --- /dev/null +++ b/template2/Readme.md @@ -0,0 +1 @@ +fd diff --git a/template2/docker-compose.yml b/template2/docker-compose.yml new file mode 100644 index 0000000..f353afe --- /dev/null +++ b/template2/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3' + +services: + traefik: + image: traefik:v1.7 + command: --api --docker + ports: + - 80:80 + networks: + - proxy + labels: + - "traefik.frontend.rule=Host:web.localhost" + - "traefik.port=8080" + volumes: + - ./traefik.toml:/traefik.toml + - /var/run/docker.sock:/var/run/docker.sock + nginx: + image: nginx:latest + networks: + - proxy + labels: + - "traefik.enable=true" + - "traefik.frontend.rule=PathPrefix:/static/" + - "traefik.docker.network=proxy" + influxdb: + image: quay.io/influxdb/influxdb:2.0.0-alpha + networks: + - proxy + labels: + - "traefik.enable=true" + - "traefik.backend=influx" + - "traefik.frontend.rule=Host:influx.localhost" + - "traefik.docker.network=proxy" + - "traefik.port=9999" +networks: + proxy: + external: + name: proxy + internal: + external: false diff --git a/template2/traefik.toml b/template2/traefik.toml new file mode 100644 index 0000000..c6dfbbd --- /dev/null +++ b/template2/traefik.toml @@ -0,0 +1,10 @@ +[docker] +endpoint = "unix:///var/run/docker.sock" +domain = "localhost" +watch = true +exposedByDefault = true + +[web] +address=":8080" + [web.auth.basic] + users = ["admin:$apr1$A3524hz3$4k45BqlgN1aiwOs1pjMD9."] diff --git a/traefik.toml b/traefik.toml deleted file mode 100644 index bd13970..0000000 --- a/traefik.toml +++ /dev/null @@ -1,20 +0,0 @@ -[docker] -endpoint = "unix:///var/run/docker.sock" -domain = "localhost" -watch = true -exposedByDefault = true -usebindportip = true -swarmMode = false -network = "web" -entryPoints.dash] -address=":8080" -[entryPoints.dash.auth] -[entryPoints.dash.auth.basic] - users = [ - "hakase:$apr1$hEgpZUN2$OYG3KwpzI3T1FqIg9LIbi.", - ] - -[api] -dashboard = true -entryPoint = "traefik" -debug = true \ No newline at end of file