Skip to content

Commit

Permalink
Change ports for rabbitmq, postgres, and elasticsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenbarker committed Apr 21, 2017
1 parent 777830d commit 6191a3b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ services:
elasticsearch:
image: elasticsearch:2
ports:
- 9200:9200
- 39200:9200

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 @@ -68,7 +68,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 @@ -83,4 +83,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
7 changes: 7 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import sys

import django

if os.environ.get('GEVENT') == '1':
from gevent import monkey
monkey.patch_all()
Expand All @@ -12,6 +14,11 @@
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

# Override default port for `runserver` command
django.setup()
from django.core.management.commands.runserver import Command as runserver
runserver.default_port = "38000"

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
10 changes: 5 additions & 5 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
},
]

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 @@ -317,7 +317,7 @@
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

ELASTICSEARCH_URL = os.environ.get('ELASTICSEARCH_URL', 'http://localhost:9200/')
ELASTICSEARCH_URL = os.environ.get('ELASTICSEARCH_URL', 'http://localhost:39200/')
ELASTICSEARCH_INDEX = os.environ.get('ELASTIC_SEARCH_INDEX', 'share')
ELASTICSEARCH_TIMEOUT = int(os.environ.get('ELASTICSEARCH_TIMEOUT', '45'))
ELASTICSEARCH_INDEX_VERSIONS = tuple(v for v in os.environ.get('ELASTICSEARCH_INDEX_VERSIONS', '').split(',') if v)
Expand All @@ -327,7 +327,7 @@

# Celery Settings

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

CELERY_TIMEZONE = 'UTC'
CELERYBEAT_SCHEDULE = {}
Expand Down Expand Up @@ -472,8 +472,8 @@
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('/') + '/'

OSF_API_URL = os.environ.get('OSF_API_URL', 'https://staging-api.osf.io').rstrip('/') + '/'
Expand Down

0 comments on commit 6191a3b

Please sign in to comment.