jfederico 4 роки тому
коміт
e47e1c0d82
11 змінених файлів з 200 додано та 0 видалено
  1. 13
    0
      .gitignore
  2. 13
    0
      README.md
  3. 66
    0
      docker-compose.yml
  4. 2
    0
      dotenv
  5. 25
    0
      nginx/default/html/index.html
  6. 37
    0
      nginx/nginx.conf
  7. 37
    0
      nginx/sites.template
  8. 0
    0
      redis/.keep
  9. 1
    0
      scalelite/.env
  10. 5
    0
      scalelite/bin/start
  11. 1
    0
      scalelite/dotenv

+ 13
- 0
.gitignore Переглянути файл

@@ -0,0 +1,13 @@
1
+/.env
2
+
3
+/nginx/log*
4
+/nginx/ssl*
5
+/nginx/sites-available*
6
+/nginx/sites-enabled*
7
+/nginx/letsencrypt/live/*
8
+
9
+/redis/log*
10
+/redis/data*
11
+
12
+/scalelite/log*
13
+/scalelite/tmp*

+ 13
- 0
README.md Переглянути файл

@@ -0,0 +1,13 @@
1
+# scalelite-run
2
+
3
+This document provides instructions on how to deploy scalelite + redis behind a nginx proxy
4
+using docker-compose.
5
+
6
+
7
+## Prerequisites
8
+
9
+
10
+## Preliminary steps
11
+
12
+
13
+## Steps

+ 66
- 0
docker-compose.yml Переглянути файл

@@ -0,0 +1,66 @@
1
+version: '3'
2
+
3
+volumes:
4
+  database_data:
5
+    driver: local
6
+
7
+services:
8
+  nginx:
9
+    image: nginx:latest
10
+    restart: "no"
11
+    volumes:
12
+      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
13
+      - ./nginx/sites-enabled:/etc/nginx/sites-enabled
14
+      - ./nginx/sites.template:/etc/nginx/sites-available/sites.template
15
+      - ./nginx/default/html:/var/www/html
16
+      - ./nginx/log/nginx:/var/log/nginx
17
+      - ./nginx/letsencrypt/:/etc/letsencrypt
18
+    ports:
19
+      - "80:80"
20
+      - "443:443"
21
+    environment:
22
+      - NGINX_DOMAIN=${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}
23
+    depends_on:
24
+      - scalelite
25
+    command: /bin/bash -c "envsubst '$$NGINX_DOMAIN' < /etc/nginx/sites-available/sites.template > /etc/nginx/sites-enabled/sites.conf && exec nginx -g 'daemon off;'"
26
+
27
+  redis:
28
+    image: redis
29
+    restart: "no"
30
+    ports:
31
+      - 127.0.0.1:6379:6379
32
+    expose:
33
+      - "6379"
34
+    networks:
35
+      - default
36
+#    volumes:
37
+#      - ./redis/data/dump.rdb:/var/lib/redis/dump.rdb
38
+#      - ./redis/log/:/var/log/
39
+
40
+  scalelite:
41
+    entrypoint: [bin/start]
42
+#    image: blindsidenetwks/scalelite:master
43
+    image: blindsidenetwks/scalelite:docker-pro
44
+    restart: "no"
45
+    ports:
46
+      - 127.0.0.1:3000:3000
47
+    expose:
48
+      - "3000"
49
+    links:
50
+      - redis
51
+    networks:
52
+      - default
53
+    volumes:
54
+      - ./scalelite/log:/usr/src/app/log
55
+      - ./scalelite/tmp/pids/:/usr/src/app/tmp/pids
56
+      - ./scalelite/bin/start:/usr/src/app/bin/start
57
+#    logging:
58
+#      driver: syslog
59
+#      options:
60
+#        syslog-address: udp://logs.$DOMAINNAME:1514
61
+#        tag: sl.$DOMAINNAME
62
+    env_file: ./scalelite/.env
63
+    environment:
64
+      - DOMAINNAME=${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}
65
+      - REDIS_URL=redis://redis.${DOMAIN_SUB:-xlab}.${DOMAIN_ROOT:-bigbluebutton.org}:6379
66
+      - URL_HOST=sl.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org}

+ 2
- 0
dotenv Переглянути файл

@@ -0,0 +1,2 @@
1
+DOMAIN_ROOT=bigbluebutton.org
2
+DOMAIN_SUB=lab

+ 25
- 0
nginx/default/html/index.html Переглянути файл

@@ -0,0 +1,25 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+<title>Welcome to nginx!</title>
5
+<style>
6
+    body {
7
+        width: 35em;
8
+        margin: 0 auto;
9
+        font-family: Tahoma, Verdana, Arial, sans-serif;
10
+    }
11
+</style>
12
+</head>
13
+<body>
14
+<h1>Welcome to nginx!</h1>
15
+<p>If you see this page, the nginx web server is successfully installed and
16
+working. Further configuration is required.</p>
17
+
18
+<p>For online documentation and support please refer to
19
+<a href="http://nginx.org/">nginx.org</a>.<br/>
20
+Commercial support is available at
21
+<a href="http://nginx.com/">nginx.com</a>.</p>
22
+
23
+<p><em>Thank you for using nginx.</em></p>
24
+</body>
25
+</html>

+ 37
- 0
nginx/nginx.conf Переглянути файл

@@ -0,0 +1,37 @@
1
+user  nginx;
2
+worker_processes  1;
3
+
4
+error_log  /var/log/nginx/error.log warn;
5
+pid        /var/run/nginx.pid;
6
+
7
+
8
+events {
9
+    worker_connections  1024;
10
+}
11
+
12
+
13
+http {
14
+    include       /etc/nginx/mime.types;
15
+    default_type  application/octet-stream;
16
+
17
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
18
+                      '$status $body_bytes_sent "$http_referer" '
19
+                      '"$http_user_agent" "$http_x_forwarded_for"';
20
+
21
+    access_log  /var/log/nginx/access.log  main;
22
+
23
+    sendfile        on;
24
+    #tcp_nopush     on;
25
+
26
+    keepalive_timeout  65;
27
+
28
+    #gzip  on;
29
+
30
+    include /etc/nginx/conf.d/*.conf;
31
+
32
+    ##
33
+    # Virtual Host Configs
34
+    ##
35
+
36
+    include /etc/nginx/sites-enabled/*;
37
+}

+ 37
- 0
nginx/sites.template Переглянути файл

@@ -0,0 +1,37 @@
1
+#### For <sl.$NGINX_DOMAIN>
2
+
3
+upstream docker-scalelite {
4
+    server scalelite:3000;
5
+}
6
+
7
+server {
8
+    server_name sl.$NGINX_DOMAIN;
9
+
10
+    listen 80;
11
+    listen [::]:80;
12
+    listen 443 ssl;
13
+    listen [::]:443;
14
+
15
+    ssl_certificate /etc/letsencrypt/live/sl.$NGINX_DOMAIN/fullchain.pem;
16
+    ssl_certificate_key /etc/letsencrypt/live/sl.$NGINX_DOMAIN/privkey.pem;
17
+
18
+    location / {
19
+            proxy_pass  http://docker-scalelite;
20
+            proxy_read_timeout 60s;
21
+            proxy_redirect off;
22
+
23
+            proxy_set_header  Host $http_host;
24
+
25
+            proxy_set_header  X-Real-IP $remote_addr;
26
+            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
27
+            proxy_set_header  Cookie "$http_cookie; ip=$remote_addr";
28
+
29
+            proxy_set_header  X-Forwarded-Proto $scheme;
30
+
31
+            proxy_http_version 1.1;
32
+            proxy_set_header Upgrade $http_upgrade;
33
+            proxy_set_header Connection "upgrade";
34
+
35
+            rewrite ~/(.*)$ /$1 break;
36
+    }
37
+}

+ 0
- 0
redis/.keep Переглянути файл


+ 1
- 0
scalelite/.env Переглянути файл

@@ -0,0 +1 @@
1
+SECRET_KEY_BASE=secret_key_base

+ 5
- 0
scalelite/bin/start Переглянути файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+bundle exec puma -C config/puma.rb
4
+#tail -f /dev/null
5
+#bundle exec rails s -b 0.0.0.0 -p 3000

+ 1
- 0
scalelite/dotenv Переглянути файл

@@ -0,0 +1 @@
1
+SECRET_KEY_BASE=secret_key_base

Завантаження…
Відмінити
Зберегти