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