Поднимаю службу контейнеров в докере.В качестве прокси выступает Traefik Docker-compose:
version: '3.3'
services:
traefik:
image: traefik:latest
security_opt:
- no-new-privileges:true
volumes:
- $PWD/wolumes/traefik.yml:/etc/traefik/traefik.yml
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
- $PWD/wolumes/data/acme.json:/acme.json
ports:
- "80:80"
- "443:443"
restart: unless-stopped
postgres:
image: postgres:12.10-alpine
container_name: postgres
volumes:
- ${PWD}/wolumes/postgres:/var/lib/postgresql/data
env_file:
- ${PWD}/wolumes/env/postgres.env
restart: unless-stopped
gogs:
image: gogs/gogs
container_name: gogs
volumes:
- ${PWD}/wolumes/gogs:/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.gogs.entrypoints=https"
- "traefik.http.routers.gogs.rule=Host(`mydomain.xyz`)"
- "traefik.http.routers.gogs.tls=true"
- "traefik.http.routers.gogs.tls.certresolver=letsEncrypt"
- "traefik.http.services.gogs-service.loadbalancer.server.port=3000"
ports:
- "8022:22"
- "3000:3000"
depends_on:
- postgres
restart: unless-stopped
nexus:
image: sonatype/nexus3
container_name: nexus
volumes:
- ${PWD}/wolumes/nexus-data:/nexus-data
ports:
- "8081:8081"
labels:
- "traefik.enable=true"
- "traefik.http.routers.nexus.entrypoints=https"
- "traefik.http.routers.nexus.rule=Host(`mydomain.xyz`)"
- "traefik.http.routers.nexus.tls=true"
- "traefik.http.routers.nexus.tls.certresolver=letsEncrypt"
- "traefik.http.services.nexus-service.loadbalancer.server.port=8081"
restart: unless-stopped
jenkins:
image: tilk9092/jenkins_gogs:latest
container_name: jenkins
user: '1000'
volumes:
- ${PWD}/wolumes/jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable=true"
- "traefik.http.routers.jenkins.entrypoints=https"
- "traefik.http.routers.jenkins.rule=Host(`mydomain.xyz`)"
- "traefik.http.routers.jenkins.tls=true"
- "traefik.http.routers.jenkins.tls.certresolver=letsEncrypt"
- "traefik.http.services.jenkins-service.loadbalancer.server.port=8080"
ports:
- "8080:8080"
- "50000:50000"
restart: unless-stopped
volumes:
html:
vho
Traefik.yml:
entryPoints:
http:
address: ":80"
https:
address: ":443"
http:
routers:
http-catchall:
rule: hostregexp(`{host:.+}`)
entrypoints:
- http
middlewares:
- redirect-to-https
middlewares:
redirect-to-https:
redirectScheme:
scheme: https
permanent: false
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
certificatesResolvers:
letsEncrypt:
acme:
email: [email protected]
storage: acme.json
caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
httpChallenge:
entryPoint: http
По итогу все службы запускаются,но браузеры ругаются на "Соединение не установлено: Вероятная угроза безопасности".Также показывает незащищенное соединение. Идеи?