HSG-MCS-HS21_tapas/docker-compose.yml

58 lines
2.1 KiB
YAML
Raw Normal View History

2021-10-04 07:13:00 +00:00
version: "3.0"
services:
reverse-proxy:
image: traefik:v2.1.3
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker=true
- --certificatesResolvers.le.acme.httpChallenge.entryPoint=web
- --certificatesresolvers.le.acme.email=martin.eigenmann@unisg.ch
- --certificatesresolvers.le.acme.storage=/acme.json
- --providers.docker.exposedByDefault=false
- --serversTransport.insecureSkipVerify=true
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./acme.json:/acme.json
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
tapas-tasks:
image: openjdk
command: "java -jar /data/tapas-tasks-0.0.1-SNAPSHOT.jar"
restart: unless-stopped
volumes:
- ./:/data/
labels:
- "traefik.enable=true"
- "traefik.http.routers.tapas-tasks.rule=Host(`tapas-tasks.${PUB_IP}.nip.io`)"
- "traefik.http.routers.tapas-tasks.service=tapas-tasks"
- "traefik.http.services.tapas-tasks.loadbalancer.server.port=8081"
- "traefik.http.routers.tapas-tasks.tls=true"
- "traefik.http.routers.tapas-tasks.entryPoints=web,websecure"
- "traefik.http.routers.tapas-tasks.tls.certresolver=le"
app:
image: openjdk
command: "java -jar /data/app-0.1.0.jar"
restart: unless-stopped
volumes:
- ./:/data/
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`app.${PUB_IP}.nip.io`)"
- "traefik.http.routers.app.service=app"
- "traefik.http.services.app.loadbalancer.server.port=8080"
- "traefik.http.routers.app.tls=true"
- "traefik.http.routers.app.entryPoints=web,websecure"
- "traefik.http.routers.app.tls.certresolver=le"