Skip to content

Commit

Permalink
Fix traefik v2 confs
Browse files Browse the repository at this point in the history
  • Loading branch information
anqqa committed Oct 29, 2019
1 parent 20858ce commit e5fb204
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/src/swagger.ts
Expand Up @@ -4,7 +4,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
export const setupSwagger = (app: INestApplication) => {
const options = new DocumentBuilder()
.setTitle('Klubitus API')
.setSchemes('https')
// .setSchemes('https')
.addTag('Events', 'Event calendar')
.addTag('Forum', 'Discussion forums')
.addTag('Images', 'Image galleries')
Expand Down
18 changes: 8 additions & 10 deletions docker-compose.yml
Expand Up @@ -19,13 +19,11 @@ services:
- web
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/traefik.toml:/traefik.toml
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- ./traefik/traefik.yml:/traefik.yml
- ./traefik/acme.json:/acme.json
labels:
- "traefik.backend=dashboard"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:${DASHBOARD_HOST}"
- "traefik.http.routers.dashboard.rule=Host(`${DASHBOARD_HOST}`)"
- "traefik.port=${DASHBOARD_PORT}"

db:
Expand Down Expand Up @@ -88,10 +86,10 @@ services:
expose:
- ${API_PORT}
labels:
- "traefik.backend=api"
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:${API_HOST}"
- "traefik.http.routers.api.rule=Host(`${API_HOST}`)"
# - "traefik.http.routers.default.tls.certresolver=default"
- "traefik.port=${API_PORT}"
depends_on:
- reverse-proxy
Expand All @@ -111,7 +109,8 @@ services:
environment:
- API_HOST
- API_PORT
- "API_URL_BROWSER=https://${API_HOST}"
- API_PROTOCOL
- "API_URL_BROWSER=${API_PROTOCOL}://${API_HOST}"
- AWS_BUCKET
- CLIENT_HOST
- CLIENT_PORT
Expand All @@ -125,10 +124,9 @@ services:
expose:
- ${CLIENT_PORT}
labels:
- "traefik.backend=client"
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:${CLIENT_HOST}"
- "traefik.http.routers.client.rule=Host(`${CLIENT_HOST}`)"
- "traefik.port=${CLIENT_PORT}"
depends_on:
- reverse-proxy
Expand Down
Empty file added traefik/acme.json
Empty file.
45 changes: 45 additions & 0 deletions traefik/traefik.yml
@@ -0,0 +1,45 @@
global:
checkNewVersion: true

log:
level: INFO


entryPoints:
http:
address: :80
https:
address: :443

http:
routers:
dashboard:
service: api@internal

api:
entryPoints:
- http
# - https

client:
entryPoints:
- http
# - https


providers:
docker:
exposedByDefault: false

# Dashboard
api:
insecure: true

# Let's Encrypt
certificatesResolvers:
default:
acme:
email: anqqa@klubitus.org
storage: acme.json
httpChallenge:
entryPoint: http

0 comments on commit e5fb204

Please sign in to comment.