Skip to content
Snippets Groups Projects
Unverified Commit 82492a72 authored by Khemissi Amir's avatar Khemissi Amir Committed by GitHub
Browse files

Deployment: Added required files. (#4638)

parent 941c22df
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
if [ -f .env ]; then
export $(echo $(cat .env | sed 's/#.*//g'| xargs) | envsubst)
fi
export PORT="${PORT:=3000}"
echo "Web app starting on port: $PORT"
PORT="${PORT:=3000}"
PGHOST=postgres
PGPORT=5432
RSHOST=redis
RSPORT=6379
echo "Greenlight-v3 starting on port: $PORT"
rails assets:precompile
if [ "$RAILS_ENV" = "production" ]; then
while ! rails db:version 2>/dev/null
while ! nc -zw3 $PGHOST $PGPORT
do
echo "Waiting for postgres to start up ..."
sleep 1
done
while ! nc -zw3 $RSHOST $RSPORT
do
echo "Waiting for redis to start up ..."
sleep 1
done
fi
rails assets:precompile
rails db:create
rails db:migrate:with_data
......
......@@ -6,5 +6,5 @@ test:
production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
url: <%= ENV.fetch("REDIS_URL")
channel_prefix: greenlight_production
version: '3'
services:
postgres:
image: postgres:14.6-alpine3.17
container_name: postgres
restart: unless-stopped
volumes:
- ./data/postgres/14/database_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=
redis:
image: redis:6.2-alpine3.17
container_name: redis
restart: unless-stopped
volumes:
- ./data/redis/database_data:/data
greenlight-v3:
entrypoint: [bin/start]
image: bigbluebutton/greenlight:v3
container_name: greenlight-v3
restart: unless-stopped
env_file: .env
ports:
- 127.0.0.1:5050:3000
logging:
driver: journald
volumes:
- ./data/greenlight-v3/storage:/usr/src/app/storage
depends_on:
- postgres
- redis
### Greenlight version 3:
location /cable {
proxy_pass http://127.0.0.1:5050;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_http_version 1.1;
proxy_read_timeout 6h;
proxy_send_timeout 6h;
client_body_timeout 6h;
send_timeout 6h;
}
location @bbb-fe {
proxy_pass http://127.0.0.1:5050;
proxy_read_timeout 60s;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Cookie "$http_cookie; ip=$remote_addr";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
client_max_body_size 30m;
rewrite ~/(.*)$ /$1 break;
}
# DATABASE URL
# Must be in the format postgres://username:password@host:port/name
### POSTGRES DATABASE URL
# Must be in the format postgres://username:password@host:port/dbname
# E.g. postgres://postgres:password@postgres:5432/greenlight-v3-production
DATABASE_URL=
# The endpoint and secret for your BigBlueButton server.
### REDIS CACHE URL
# Must be in the format redis://host:port
# E.g. redis://redis:6379
REDIS_URL=
### The endpoint and secret for your BigBlueButton server.
# Set these if you are running GreenLight on a single BigBlueButton server.
# You can retrive these by running the following command on your BigBlueButton server:
# You can retrieve these by running the following command on your BigBlueButton server:
#
# bbb-conf --secret
#
BIGBLUEBUTTON_ENDPOINT=
BIGBLUEBUTTON_SECRET=
#BIGBLUEBUTTON_ENDPOINT=
#BIGBLUEBUTTON_SECRET=
# To enable hCaptcha on the user sign up and sign in, define these 2 keys
#
HCAPTCHA_SITE_KEY=
HCAPTCHA_SECRET_KEY=
#HCAPTCHA_SITE_KEY=
#HCAPTCHA_SECRET_KEY=
# Set these if you are using a Simple Storage Service (S3)
# Uncomment S3_ENDPOINT only if you are using a S3 OTHER than Amazon Web Service (AWS) S3.
#
#S3_ACCESS_KEY_ID=
#S3_SECRET_ACCESS_KEY=
#S3_REGION=
#S3_BUCKET=
#S3_ENDPOINT=
PORT=
### GL3 secret key base.
# openssl rand -hex 64
SECRET_KEY_BASE=
RAILS_ENV=
RAILS_SERVE_STATIC_FILES=
# OpenId configuration:
#OPENID_CONNECT_CLIENT_ID=
#OPENID_CONNECT_CLIENT_SECRET=
#OPENID_CONNECT_ISSUER=
#OPENID_CONNECT_REDIRECT=
#OPENID_CONNECT_UID_FIELD=
#PORT=
#RAILS_ENV=
#RAILS_SERVE_STATIC_FILES=
# Define the default locale language code (i.e. 'en' for English) from the fallowing list:
# [en, ar, fr, es]
DEFAULT_LOCALE=
#DEFAULT_LOCALE=en
# SMTP configuration:
#SMTP_SENDER_EMAIL=
......@@ -54,3 +53,10 @@ DEFAULT_LOCALE=
#SMTP_STARTTLS=false
#SMTP_TLS=true
#SMTP_SSL_VERIFY=true
# OpenID configuration:
#OPENID_CONNECT_CLIENT_ID=
#OPENID_CONNECT_CLIENT_SECRET=
#OPENID_CONNECT_ISSUER=
#OPENID_CONNECT_REDIRECT=
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment