Browse Source

Integrating DiceBot and Mumble in docker-compose

Ticket #610 @1h50m
960
Martin Bober 5 years ago
parent
commit
447b8638cf
  1. 3
      .dockerignore
  2. 1
      Readme.md
  3. 5
      app/assets/javascripts/dicebot_connection.coffee
  4. 3
      app/views/layouts/application.html.erb
  5. 22
      docker-compose.yml

3
.dockerignore

@ -1,2 +1,3 @@
.git/
log/*
log/*
tmp/

1
Readme.md

@ -12,6 +12,7 @@ The following environmental variables are being used:
| RAILS_DB_PASSWD | MySQL password to use in Production and Development. |
| SECRET_KEY_BASE | Secret to use in Production |
| RAILS_ENV | Rails environment to use. Defaults to `production`. |
| DICEBOT_URL | URL to use for DiceBot connection, for example: `https://dicebot.charxchange.com`. |
| RAILS_MAILER_METHOD | Method used to deliver mails in production. Should be `test` (default) or `smtp`
| RAILS_SMTP_SERVER | SMTP server to use for mail delivery. |
| RAILS_SMTP_PORT | Port to use for mail delivery, for example: `25` |

5
app/assets/javascripts/dicebot_connection.coffee

@ -3,10 +3,7 @@
constructor: () ->
@connected = false
@listeners = []
if window.RAILS_PRODUCTION
@url = "https://dicebot.charxchange.com"
else
@url = "http://localhost:8080"
@url = window.DICEBOT_URL
addListener: (listener) ->
@listeners.push listener

3
app/views/layouts/application.html.erb

@ -12,7 +12,8 @@
window.addEventListener("hashchange", shiftWindow);
function load() { if (window.location.hash) shiftWindow(); }
window.RAILS_PRODUCTION = <%= Rails.env.production? %>;
window.RAILS_PRODUCTION = "<%= Rails.env.production? %>";
window.DICEBOT_URL = "<%= ENV['DICEBOT_URL']%>";
</script>
</head>
<body onload="load()">

22
docker-compose.yml

@ -2,11 +2,31 @@
version: '2'
volumes:
mumble_config:
mumble_data:
production_paperclip_data:
development_paperclip_data:
test_paperclip_data:
services:
mumble:
image: luzifer/mumble:latest
ports:
- "64738:64738"
volumes:
- mumble_config:/config
- mumble_data:/data
dicebot:
image: mumble-rtc-dicebot
ports:
- "8100:8080"
links:
- mumble
environment:
MUMBLE_SERVER: mumble
production_db:
image: mysql/mysql-server:5.7
ports:
@ -29,6 +49,7 @@ services:
RAILS_DB_USER: root
RAILS_DB_PASSWD: charxchange
SECRET_KEY_BASE: '894b26dfa5417b3fa1c0c30bbb7be0bd32539d533fa16b690b53d15b0ddd5b0b3c37ffb1ce99e77a4c00c28d0a961e6414b5d09814feecb17cc6ffdbaa7652a9'
DICEBOT_URL: "http://localhost:8100"
volumes:
- production_paperclip_data:/usr/src/app/public/system
@ -53,6 +74,7 @@ services:
RAILS_DB_NAME: charxchange
RAILS_DB_USER: root
RAILS_DB_PASSWD: charxchange
DICEBOT_URL: "http://localhost:8100"
volumes:
- ".:/usr/src/app"
- development_paperclip_data:/usr/src/app/public/system

Loading…
Cancel
Save