local usage

This commit is contained in:
Rémi Heredero 2024-02-14 12:02:14 +01:00
parent bc6e7b6271
commit b2520772b1

View File

@ -3,7 +3,7 @@ version: '3'
services: services:
traefik: traefik:
image: traefik:v2.9 image: traefik
restart: unless-stopped restart: unless-stopped
ports: ports:
# Read this on how to open ports # Read this on how to open ports
@ -11,28 +11,51 @@ services:
- "80:80" - "80:80"
- "443:443" - "443:443"
volumes: volumes:
- C:\tmp\var\run\docker.sock:/var/run/docker.sock #- /var/run/docker.sock:/var/run/docker.sock
- C:\traefik.yml:/etc/traefik/traefik.yml - "////./pipe/docker_engine:/var/run/docker.sock"
- C:\authorized_users:/etc/traefik/authorized_users - ./traefik.yml:/etc/traefik/traefik.yml
- C:\acme.json:/acme.json - ./authorized_users:/etc/traefik/authorized_users
- ./acme.json:/acme.json
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.dashboard-http.entrypoints=http" - "traefik.http.routers.dashboard-http.entrypoints=http"
- "traefik.http.routers.dashboard-http.rule=Host(`server.ava.kb28.ch`,`server.ava.jcloud.ik-server.com`)" - "traefik.http.routers.dashboard-http.rule=Host(`localhost/`)"
- "traefik.http.routers.dashboard-http.middlewares=dashboard-redirect" - "traefik.http.routers.dashboard-http.middlewares=dashboard-redirect"
- "traefik.http.middlewares.dashboard-redirect.redirectscheme.scheme=https" - "traefik.http.middlewares.dashboard-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.dashboard-https.entrypoints=https" - "traefik.http.routers.dashboard-https.entrypoints=https"
- "traefik.http.routers.dashboard-https.rule=(Host(`server.ava.kb28.ch`,`server.ava.jcloud.ik-server.com`)) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))" - "traefik.http.routers.dashboard-https.rule=(Host(`localhost/`)) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard-https.tls.certResolver=letsencrypt" - "traefik.http.routers.dashboard-https.tls.certResolver=letsencrypt"
- "traefik.http.routers.dashboard-https.service=api@internal" - "traefik.http.routers.dashboard-https.service=api@internal"
- "traefik.http.routers.dashboard-https.middlewares=dashboard-auth" - "traefik.http.routers.dashboard-https.middlewares=dashboard-auth"
- "traefik.http.middlewares.dashboard-auth.basicauth.usersfile=/etc/traefik/authorized_users" - "traefik.http.middlewares.dashboard-auth.basicauth.usersfile=/etc/traefik/authorized_users"
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Add a constraint to only use services with the label "traefik.constraint-label=traefik-public"
#- --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`)
# Do not expose all Docker services, only the ones explicitly exposed
#- --providers.docker.exposedbydefault=false
# Enable Docker Swarm mode
- --providers.docker.swarmmode
# Create an entrypoint "http" listening on port 80
- --entrypoints.http.address=:80
# Create an entrypoint "https" listening on port 443
- --entrypoints.https.address=:443
# Create the certificate resolver "le" for Let's Encrypt, uses the environment variable EMAIL
#- --certificatesresolvers.le.acme.email='cboivin@secure-exchanges.com'#$EMAIL
# Store the Let's Encrypt certificates in the mounted volume
#- --certificatesresolvers.le.acme.storage=/certificates/acme.json
# Use the TLS Challenge for Let's Encrypt
#- --certificatesresolvers.le.acme.tlschallenge=true
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
# Enable the Dashboard and API
- --api.insecure=true
ubuntu-test: # Docker engine
build: ./ubuntu-test - --providers.docker.endpoint=npipe:////./pipe/docker_engine
restart: unless-stopped
ports:
- '25057:22'
ollama: ollama:
image: ollama/ollama image: ollama/ollama
@ -41,14 +64,14 @@ services:
ports: ports:
- '11434:11434' - '11434:11434'
volumes: volumes:
- 'C:\tmp\ollama:/root/.ollama' - './ollama:/root/.ollama'
ollama-webui: ollama-webui:
image: 'ghcr.io/ollama-webui/ollama-webui:main' image: 'ghcr.io/ollama-webui/ollama-webui:main'
restart: unless-stopped restart: unless-stopped
container_name: ollama-webui container_name: ollama-webui
volumes: volumes:
- 'C:\tmp\ollama-webui:/app/backend/data' - './ollama-webui:/app/backend/data'
depends_on: depends_on:
- ollama - ollama
ports: ports:
@ -60,11 +83,11 @@ services:
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.ollama-webui-http.entrypoints=http" - "traefik.http.routers.ollama-webui-http.entrypoints=http"
- "traefik.http.routers.ollama-webui-http.rule=Host(`ollama.ava.kb28.ch`,`ollama.ava.jcloud.ik-server.com`)" - "traefik.http.routers.ollama-webui-http.rule=Host(`ollama.localhost/`)"
- "traefik.http.routers.ollama-webui-http.middlewares=ollama-webui-redirect" - "traefik.http.routers.ollama-webui-http.middlewares=ollama-webui-redirect"
- "traefik.http.middlewares.ollama-webui-redirect.redirectscheme.scheme=https" - "traefik.http.middlewares.ollama-webui-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.ollama-webui-https.entrypoints=https" - "traefik.http.routers.ollama-webui-https.entrypoints=https"
- "traefik.http.routers.ollama-webui-https.rule=Host(`ollama.ava.kb28.ch`,`ollama.ava.jcloud.ik-server.com`)" - "traefik.http.routers.ollama-webui-https.rule=Host(`ollama.localhost/`)"
- "traefik.http.routers.ollama-webui-https.tls.certResolver=letsencrypt" - "traefik.http.routers.ollama-webui-https.tls.certResolver=letsencrypt"
- "traefik.http.routers.ollama-webui-https.service=ollama-webui" - "traefik.http.routers.ollama-webui-https.service=ollama-webui"
- "traefik.http.routers.ollama-webui-https.middlewares=ollama-webui-auth" - "traefik.http.routers.ollama-webui-https.middlewares=ollama-webui-auth"