host
This commit is contained in:
parent
7b5ee5531c
commit
b5cdfd362e
@ -5,8 +5,6 @@ stages:
|
||||
|
||||
variables:
|
||||
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
||||
DB_HOST: "postgres"
|
||||
RABBIT_HOST: "rabbitmq"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
@ -36,8 +34,7 @@ deploy-dev:
|
||||
variables:
|
||||
PORT: 80
|
||||
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
||||
DB_HOST: "postgres"
|
||||
RABBIT_HOST: "rabbitmq"
|
||||
HOST: "http://dev.sprinthub.ru/"
|
||||
|
||||
deploy-prod:
|
||||
extends:
|
||||
|
@ -16,6 +16,9 @@ import os
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
HOST = os.getenv("HOST", "0.0.0.0")
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
|
||||
|
||||
@ -83,7 +86,7 @@ DATABASES = {
|
||||
"NAME": "sprint",
|
||||
"USER": "postgres",
|
||||
"PASSWORD": os.getenv("DB_PASSWORD", "password"),
|
||||
"HOST": os.getenv("DB_HOST", "0.0.0.0"),
|
||||
"HOST": HOST,
|
||||
"PORT": 5432,
|
||||
}
|
||||
}
|
||||
@ -140,7 +143,7 @@ for root in DATA_ROOT, EXTRA_FILES_ROOT, MEDIA_ROOT:
|
||||
|
||||
SOLUTIONS_ROOT = os.path.join(DATA_ROOT, "solutions")
|
||||
|
||||
RABBIT_HOST = os.getenv("RABBIT_HOST", "0.0.0.0")
|
||||
RABBIT_HOST = HOST
|
||||
RABBIT_PORT = 5672
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
|
@ -22,8 +22,7 @@ services:
|
||||
restart: always
|
||||
environment:
|
||||
PORT: $PORT
|
||||
DB_HOST: $DB_HOST
|
||||
RABBIT_HOST: $RABBIT_HOST
|
||||
HOST: $HOST
|
||||
command: scripts/runserver.sh
|
||||
ports:
|
||||
- "${PORT}:${PORT}"
|
||||
@ -37,6 +36,8 @@ services:
|
||||
bot:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
restart: always
|
||||
environment:
|
||||
HOST: $HOST
|
||||
command: python manage.py bot
|
||||
depends_on:
|
||||
- web
|
||||
@ -57,8 +58,7 @@ services:
|
||||
command: scripts/create_worker.sh
|
||||
environment:
|
||||
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
|
||||
DB_HOST: "${DB_HOST}"
|
||||
RABBIT_HOST: "${RABBIT_HOST}"
|
||||
HOST: $HOST
|
||||
depends_on:
|
||||
- web
|
||||
- rabbitmq
|
||||
|
Loading…
Reference in New Issue
Block a user