traefik
This commit is contained in:
28
README.md
28
README.md
@@ -143,6 +143,19 @@ Test the web app
|
||||
curl http://localhost:8080/
|
||||
```
|
||||
## Expose the app on Internet behind the reverse proxy (Traefik)
|
||||
Create a 'labels' file for Traefik
|
||||
```bash
|
||||
sudo tee labels <<EOF
|
||||
traefik.enable=true
|
||||
traefik.docker.network=traefik
|
||||
traefik.http.routers.virt-nexus-timer.rule=Host("nexus-timer.virtonline.eu")
|
||||
traefik.http.routers.virt-nexus-timer.service=virt-nexus-timer
|
||||
traefik.http.routers.virt-nexus-timer.tls=true
|
||||
traefik.http.routers.virt-nexus-timer.tls.certResolver=default
|
||||
traefik.http.routers.virt-nexus-timer.entrypoints=web-secure
|
||||
traefik.http.services.virt-nexus-timer.loadbalancer.server.port=80
|
||||
EOF
|
||||
```
|
||||
Create the systemd service file
|
||||
```bash
|
||||
sudo systemctl edit --force --full virt-nexus-timer.service
|
||||
@@ -164,19 +177,8 @@ ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker rm virt-nexus-timer 2>/dev
|
||||
ExecStart=/usr/bin/env docker run \
|
||||
--rm \
|
||||
--name=virt-nexus-timer \
|
||||
--cap-drop=ALL \
|
||||
--read-only \
|
||||
--user=997:1002 \
|
||||
--log-driver=none \
|
||||
--network=traefik \
|
||||
--label 'traefik.enable=true' \
|
||||
--label 'traefik.docker.network=traefik' \
|
||||
--label 'traefik.http.routers.virt-nexus-timer.rule=Host("nexus-timer.virtonline.eu")' \
|
||||
--label 'traefik.http.routers.virt-nexus-timer.service=virt-nexus-timer' \
|
||||
--label 'traefik.http.routers.virt-nexus-timer.tls=true' \
|
||||
--label 'traefik.http.routers.virt-nexus-timer.tls.certResolver=default' \
|
||||
--label 'traefik.http.routers.virt-nexus-timer.entrypoints=web-secure' \
|
||||
--label 'traefik.http.services.virt-nexus-timer.loadbalancer.server.port=80' \
|
||||
--network=traefik-net \
|
||||
--label-file /opt/nexus-timer/labels \
|
||||
virt-nexus-timer
|
||||
|
||||
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker kill virt-nexus-timer 2>/dev/null || true'
|
||||
|
||||
Reference in New Issue
Block a user