Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SHARE-746][Improvement] Change ports for rabbitmq, postgres, and elasticsearch #629

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ services:
elasticsearch:
image: elasticsearch:5.4
ports:
- 9200:9200
- 39200:9200
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"

rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
- 15672:15672
- 35672:5672
- 45672:15672

postgres:
image: postgres
command: /bin/bash -c "sed -i -e 's/max_connections.*/max_connections = 5000/' /var/lib/postgresql/data/postgresql.conf || true && sed -i -e 's/#log_min_duration_statement = .*/log_min_duration_statement = 0/' /var/lib/postgresql/data/postgresql.conf || true && /docker-entrypoint.sh postgres"
ports:
- 5432:5432
- 35432:5432
environment:
POSTGRES_DB: share

Expand Down Expand Up @@ -70,7 +70,7 @@ services:
build: .
command: python manage.py runserver --noreload 0.0.0.0:8000
ports:
- 8000:8000
- 38000:8000
depends_on:
- postgres
- rabbitmq
Expand All @@ -85,4 +85,4 @@ services:
DATABASE_HOST: postgres
BROKER_URL: amqp://guest:guest@rabbitmq:5672/
ELASTICSEARCH_URL: http://elasticsearch:9200/
EMBER_SHARE_URL: http://192.168.168.167:4200
EMBER_SHARE_URL: http://192.168.168.167:34200
12 changes: 6 additions & 6 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def split(string, delim):
'NAME': os.environ.get('DATABASE_NAME', 'share'),
'USER': os.environ.get('DATABASE_USER', 'postgres'),
'HOST': os.environ.get('DATABASE_HOST', 'localhost'),
'PORT': os.environ.get('DATABASE_PORT', '5432'),
'PORT': os.environ.get('DATABASE_PORT', '35432'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD', None),
'CONN_MAX_AGE': int(os.environ.get('CONN_MAX_AGE', 0 if DEBUG else 60)),
'TEST': {'SERIALIZE': False},
Expand All @@ -227,7 +227,7 @@ def split(string, delim):
},
]

LOGIN_REDIRECT_URL = os.environ.get('LOGIN_REDIRECT_URL', 'http://localhost:8000/')
LOGIN_REDIRECT_URL = os.environ.get('LOGIN_REDIRECT_URL', 'http://localhost:38000/')

if DEBUG:
AUTH_PASSWORD_VALIDATORS = []
Expand Down Expand Up @@ -293,7 +293,7 @@ def split(string, delim):

ELASTICSEARCH = {
'SNIFF': bool(os.environ.get('ELASTICSEARCH_SNIFF')),
'URL': os.environ.get('ELASTICSEARCH_URL', 'http://localhost:9200/'),
'URL': os.environ.get('ELASTICSEARCH_URL', 'http://localhost:39200/'),
'INDEX': os.environ.get('ELASTIC_SEARCH_INDEX', 'share'),
'TIMEOUT': int(os.environ.get('ELASTICSEARCH_TIMEOUT', '45')),
'INDEX_VERSIONS': split(os.environ.get('ELASTICSEARCH_INDEX_VERSIONS', ''), ','),
Expand Down Expand Up @@ -364,7 +364,7 @@ def split(string, delim):
# Celery Settings

CELERY_TIMEZONE = 'UTC'
CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://'),
CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://guest:guest@localhost:35672'),

CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
CELERY_BEAT_SCHEDULE = {
Expand Down Expand Up @@ -513,8 +513,8 @@ def split(string, delim):
PUBLIC_SENTRY_DSN = os.environ.get('PUBLIC_SENTRY_DSN')

EMBER_SHARE_PREFIX = os.environ.get('EMBER_SHARE_PREFIX', 'share' if DEBUG else '')
EMBER_SHARE_URL = os.environ.get('EMBER_SHARE_URL', 'http://localhost:4200').rstrip('/') + '/'
SHARE_API_URL = os.environ.get('SHARE_API_URL', 'http://localhost:8000').rstrip('/') + '/'
EMBER_SHARE_URL = os.environ.get('EMBER_SHARE_URL', 'http://localhost:34200').rstrip('/') + '/'
SHARE_API_URL = os.environ.get('SHARE_API_URL', 'http://localhost:38000').rstrip('/') + '/'
SHARE_WEB_URL = os.environ.get('SHARE_WEB_URL', SHARE_API_URL + EMBER_SHARE_PREFIX).rstrip('/') + '/'
SHARE_USER_AGENT = os.environ.get('SHARE_USER_AGENT', 'SHAREbot/{} (+{})'.format(VERSION, SHARE_WEB_URL))

Expand Down
6 changes: 6 additions & 0 deletions share/management/commands/runlocalserver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand


class Command(RunserverCommand):
# Override default port for `runserver` command
default_port = "38000"