-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #570 from Gencaster/live
Add live deployment configuration
- Loading branch information
Showing
12 changed files
with
189 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
""" | ||
Deploy Live | ||
=========== | ||
Settings for deploying "*production*" environment on the server via Docker. | ||
""" | ||
|
||
import sentry_sdk | ||
from sentry_sdk.integrations.django import DjangoIntegration | ||
|
||
from .base import * # noqa | ||
|
||
CSRF_TRUSTED_ORIGINS = [ | ||
"https://live.gencaster.org", | ||
"https://backend.live.gencaster.org", | ||
"https://editor.live.gencaster.org", | ||
] | ||
|
||
DEBUG = False | ||
|
||
ALLOWED_HOSTS = [ | ||
"*.gencaster.org", | ||
"gencaster.org", | ||
"live.gencaster.org", | ||
"editor.live.gencaster.org", | ||
"backend.live.gencaster.org", | ||
"localhost", | ||
"127.0.0.1", | ||
] | ||
|
||
CORS_ALLOWED_ORIGINS = [ | ||
"https://editor.live.gencaster.org", | ||
"https://live.gencaster.org", | ||
"https://backend.live.gencaster.org", | ||
] | ||
|
||
SESSION_COOKIE_DOMAIN = ".live.gencaster.org" | ||
CSRF_COOKIE_DOMAIN = ".live.gencaster.org" | ||
|
||
CORS_ALLOW_CREDENTIALS = True | ||
|
||
SESSION_COOKIE_SAMESITE = None | ||
|
||
CSRF_COOKIE_SECURE = True | ||
|
||
|
||
if SENTRY_DSN := os.environ.get("SENTRY_DSN_CASTER_BACK", None): | ||
print("### SENTRY LOGGING ACTIVE ###") | ||
sentry_sdk.init( | ||
dsn=SENTRY_DSN, | ||
integrations=[ | ||
DjangoIntegration(), | ||
], | ||
# Set traces_sample_rate to 1.0 to capture 100% | ||
# of transactions for performance monitoring. | ||
# We recommend adjusting this value in production. | ||
traces_sample_rate=0.2, | ||
# If you wish to associate users to errors (assuming you are using | ||
# django.contrib.auth) you may enable sending PII data. | ||
send_default_pii=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
version: '3.9' | ||
|
||
volumes: | ||
static: | ||
services: | ||
database: | ||
env_file: | ||
- vars.env | ||
- vars.deploy.live.env | ||
- .secrets.env | ||
|
||
backend: | ||
env_file: | ||
- vars.env | ||
- vars.deploy.live.env | ||
- .secrets.env | ||
volumes: | ||
- static:/home/gencaster/static:rw | ||
- ./data:/data | ||
- ./data:/home/gencaster/media | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
osc_backend: | ||
volumes: | ||
- ./data:/data | ||
- ./data:/home/gencaster/media | ||
env_file: | ||
- vars.env | ||
- vars.deploy.live.env | ||
- .secrets.env | ||
ports: | ||
- 7000:7000/udp | ||
|
||
sound: | ||
env_file: | ||
- vars.env | ||
- vars.deploy.live.env | ||
ports: | ||
- 8090:8090 # debug frontend | ||
- 8088:8088 # janus server | ||
- 10000-10200:10000-10200 | ||
volumes: | ||
- ./data:/data | ||
- ./caster-sound/janus.jcfg:/opt/janus/etc/janus/janus.jcfg | ||
|
||
nginx: | ||
image: nginx:1.23-alpine | ||
volumes: | ||
- ./nginx.deploy.conf:/etc/nginx/conf.d/default.conf | ||
- static:/static/:ro | ||
- ./data:/home/gencaster/media | ||
ports: | ||
- 8081:80 | ||
depends_on: | ||
- backend | ||
|
||
editor: | ||
platform: linux/amd64 | ||
build: | ||
context: caster-editor | ||
dockerfile: Dockerfile.deploy | ||
args: | ||
- BACKEND_URL=https://backend.live.gencaster.org | ||
- SENTRY_DSN_CASTER_EDITOR=https://4f4b994233384dc3a79ec1a4fea3cd80@o4504548423565312.ingest.sentry.io/4505476421386240 | ||
ports: | ||
- 3001:80 | ||
environment: | ||
- HOST=0.0.0.0 | ||
- PORT=3001 | ||
- BACKEND_URL="https://backend.live.gencaster.org" | ||
depends_on: | ||
- backend | ||
|
||
frontend: | ||
platform: linux/amd64 | ||
build: | ||
context: caster-front | ||
dockerfile: Dockerfile.deploy | ||
args: | ||
- BACKEND_URL=https://backend.live.gencaster.org | ||
- JANUS_URL=https://sound.live.gencaster.org/janus | ||
- SENTRY_DSN_CASTER_FRONT=https://cf06c7d74e1644cab833acf57ae598b3@o4504548423565312.ingest.sentry.io/4505476517396480 | ||
ports: | ||
- 3000:80 | ||
environment: | ||
- NGINX_HOST=0.0.0.0 | ||
depends_on: | ||
- backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SUPERCOLLIDER_HOST=sound | ||
|
||
DJANGO_SETTINGS_MODULE="gencaster.settings.deploy_live" | ||
BACKEND_OSC_HOST=osc_backend | ||
|
||
# this is needed during build time so change it in | ||
# docker-compose.deploy.dev.yml as well if this changes | ||
BACKEND_URL="https://backend.live.gencaster.org" | ||
|
||
JANUS_PUBLIC_IP=213.133.101.74 | ||
|
||
SUPERCOLLIDER_USE_INPUT=1 | ||
SUPERCOLLIDER_NUM_STREAMS=15 |