Updates for multiple entrypoints to same image

This commit is contained in:
jfederico
2020-02-11 15:13:31 -05:00
parent 52e276e023
commit 6bd5a574d9
6 changed files with 47 additions and 17 deletions

View File

@@ -21,7 +21,7 @@ services:
environment:
- NGINX_DOMAIN=${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}
depends_on:
- scalelite
- scalelite.api
command: /bin/bash -c "envsubst '$$NGINX_DOMAIN' < /etc/nginx/sites-available/sites.template > /etc/nginx/sites-enabled/sites.conf && exec nginx -g 'daemon off;'"
redis:
@@ -29,12 +29,10 @@ services:
restart: "no"
ports:
- 127.0.0.1:6379:6379
networks:
- default
volumes:
- ./redis/data/:/data
scalelite:
scalelite.api:
entrypoint: [bin/start]
image: blindsidenetwks/scalelite:master
restart: "no"
@@ -42,21 +40,30 @@ services:
- 127.0.0.1:3000:3000
links:
- redis
networks:
- default
volumes:
- ./scalelite/log:/usr/src/app/log
- ./scalelite/bin/start:/usr/src/app/bin/start
# - ./scalelite/log/api:/srv/scalelite/log
- ./scalelite/bin/start:/srv/scalelite/bin/start
- ./scalelite/tmp/pids/:/usr/src/app/tmp/pids
- ./scalelite/tmp/sockets/:/usr/src/app/tmp/sockets
- ./scalelite/tmp/cache/assets:/usr/src/app/tmp/cache/assets
# logging:
# driver: syslog
# options:
# syslog-address: udp://logs.$DOMAINNAME:1514
# tag: sl.$DOMAINNAME
env_file: ./scalelite/.env
environment:
- REDIS_URL=redis://redis:6379
- REDIS_NAMESPACE=scalelite
- URL_HOST=sl.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}
scalelite.poller:
entrypoint: [bin/start-poller]
image: blindsidenetwks/scalelite:master
restart: "no"
ports:
- 127.0.0.1:3001:3000
links:
- redis
volumes:
# - ./scalelite/log/poller:/srv/scalelite/log
- ./scalelite/bin/start-poller:/srv/scalelite/bin/start-poller
env_file: ./scalelite/.env
environment:
- REDIS_URL=redis://redis:6379
- URL_HOST=sl.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}
- INTERVAL=60

View File

@@ -1,7 +1,7 @@
#### For <sl.$NGINX_DOMAIN>
upstream docker-scalelite {
server scalelite:3000;
server scalelite.api:3000;
}
server {

View File

@@ -1 +1,2 @@
SECRET_KEY_BASE=secret_key_base
LOADBALANCER_SECRET=8cd8ef52e8e101574e400365b55e11a6

View File

@@ -1,5 +1,21 @@
#!/bin/bash
#!/bin/sh
bundle exec puma -C config/puma.rb
servers="$(RAILS_ENV=$RAILS_ENV bundle exec rake servers 2>&1)"
echo $servers
if [ "$(echo "$servers" | cut -c0-2)" == "No" ]; then
echo ">>> Add test-install as the default server"
bundle exec rake servers:add["https://test-install.blindsidenetworks.com/bigbluebutton/api","8cd8ef52e8e101574e400365b55e11a6"]
bundle exec rake servers
bundle exec rake status
else
echo ">>> Do nothing"
fi
exec tini -- bundle exec puma -C config/puma.rb "$@"
#tail -f /dev/null
#bundle exec puma -C config/puma.rb
#bundle exec rails s -b 0.0.0.0 -p 3000

5
scalelite/bin/start-poller Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
echo "Poller is starting..."
exec tini -- bundle exec rake poll["$INTERVAL"]
#tail -f /dev/null

View File

@@ -1 +1,2 @@
SECRET_KEY_BASE=secret_key_base
LOADBALANCER_SECRET=8cd8ef52e8e101574e400365b55e11a6