Compare commits
2 commits
dcba53a20e
...
f2a6d186c8
Author | SHA1 | Date | |
---|---|---|---|
f2a6d186c8 | |||
5822fa8235 |
11 changed files with 19 additions and 16 deletions
|
@ -62,17 +62,20 @@ frontend https
|
||||||
|
|
||||||
# Router
|
# Router
|
||||||
# ACL to match the sni hosts
|
# ACL to match the sni hosts
|
||||||
|
acl is_base ssl_fc_sni -i "${BASE_URL}"
|
||||||
|
acl is_api ssl_fc_sni -i "api.${BASE_URL}"
|
||||||
acl is_stream ssl_fc_sni -i "stream.${BASE_URL}"
|
acl is_stream ssl_fc_sni -i "stream.${BASE_URL}"
|
||||||
acl is_tv ssl_fc_sni -i "tv.${BASE_URL}"
|
|
||||||
|
|
||||||
# Define the ACL conditions and corresponding actions
|
# Define the ACL conditions and corresponding actions
|
||||||
|
use_backend backend_api if is_base
|
||||||
|
use_backend backend_api if is_api
|
||||||
use_backend backend_restreamer if is_stream
|
use_backend backend_restreamer if is_stream
|
||||||
use_backend backend_scheduler if is_tv
|
|
||||||
|
backend backend_api
|
||||||
|
balance leastconn
|
||||||
|
server api1 api:8080 check inter 5s rise 4 fall 2
|
||||||
|
|
||||||
backend backend_restreamer
|
backend backend_restreamer
|
||||||
balance leastconn
|
balance leastconn
|
||||||
server restreamer1 restreamer:8080 check inter 5s rise 4 fall 2
|
server restreamer1 restreamer:8080 check inter 5s rise 4 fall 2
|
||||||
|
|
||||||
backend backend_scheduler
|
|
||||||
balance leastconn
|
|
||||||
server scheduler1 scheduler:8080 check inter 5s rise 4 fall 2
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- "certbot"
|
- "certbot"
|
||||||
- "restreamer"
|
- "restreamer"
|
||||||
- "scheduler"
|
- "api"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- net
|
- net
|
||||||
|
@ -55,25 +55,25 @@ services:
|
||||||
labels:
|
labels:
|
||||||
- meta.role=restreamer
|
- meta.role=restreamer
|
||||||
|
|
||||||
scheduler:
|
api:
|
||||||
depends_on:
|
depends_on:
|
||||||
- "restreamer"
|
- "restreamer"
|
||||||
build: ./src/scheduler
|
build: ./src/api
|
||||||
image: tv-scheduler:latest
|
image: tv-api:latest
|
||||||
env_file:
|
env_file:
|
||||||
- "variables.env"
|
- "variables.env"
|
||||||
volumes:
|
volumes:
|
||||||
- "./config/scheduler:/config"
|
- "./config/api:/config"
|
||||||
- "./data/recorder:/recordings"
|
- "./data/recorder:/recordings"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- net
|
- net
|
||||||
labels:
|
labels:
|
||||||
- meta.role=scheduler
|
- meta.role=api
|
||||||
|
|
||||||
discordbot:
|
discordbot:
|
||||||
depends_on:
|
depends_on:
|
||||||
- "scheduler"
|
- "api"
|
||||||
build: ./src/discordbot
|
build: ./src/discordbot
|
||||||
image: tv-discordbot:latest
|
image: tv-discordbot:latest
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
@ -7,8 +7,8 @@ CB=`docker ps | grep certbot | cut -d ' ' -f 1`
|
||||||
#echo $BASE_URL
|
#echo $BASE_URL
|
||||||
#echo $EMAIL
|
#echo $EMAIL
|
||||||
|
|
||||||
docker exec $CB certbot certonly --non-interactive --standalone --http-01-address 0.0.0.0 --email $EMAIL --agree-tos --keep --preferred-challenges http --cert-name stream.$BASE_URL \
|
docker exec $CB certbot certonly --non-interactive --standalone --http-01-address 0.0.0.0 --email $EMAIL --agree-tos --keep --preferred-challenges http --cert-name $BASE_URL \
|
||||||
-d tv.$BASE_URL -d stream.$BASE_URL
|
-d $BASE_URL -d api.$BASE_URL -d stream.$BASE_URL
|
||||||
|
|
||||||
cat "./data/certbot/etc/live/stream.$BASE_URL/privkey.pem" "./data/certbot/etc/live/stream.$BASE_URL/fullchain.pem" > "./data/certificates/stream.$BASE_URL.pem"
|
cat "./data/certbot/etc/live/$BASE_URL/privkey.pem" "./data/certbot/etc/live/$BASE_URL/fullchain.pem" > "./data/certificates/$BASE_URL.pem"
|
||||||
docker kill -s USR2 television_haproxy_1
|
docker kill -s USR2 television_haproxy_1
|
||||||
|
|
|
@ -19,4 +19,4 @@ COPY . .
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
CMD [ "waitress-serve", "--port=8080", "--call", "scheduler:create_app"]
|
CMD [ "waitress-serve", "--port=8080", "--call", "api:create_app"]
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Loading…
Reference in a new issue