Skip to content

Commit 6191a3b

Browse files
committed
Change ports for rabbitmq, postgres, and elasticsearch
1 parent 777830d commit 6191a3b

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ services:
2828
elasticsearch:
2929
image: elasticsearch:2
3030
ports:
31-
- 9200:9200
31+
- 39200:9200
3232

3333
rabbitmq:
3434
image: rabbitmq:management
3535
ports:
36-
- 5672:5672
37-
- 15672:15672
36+
- 35672:5672
37+
- 45672:15672
3838

3939
postgres:
4040
image: postgres
4141
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"
4242
ports:
43-
- 5432:5432
43+
- 35432:5432
4444
environment:
4545
POSTGRES_DB: share
4646

@@ -68,7 +68,7 @@ services:
6868
build: .
6969
command: python manage.py runserver --noreload 0.0.0.0:8000
7070
ports:
71-
- 8000:8000
71+
- 38000:8000
7272
depends_on:
7373
- postgres
7474
- rabbitmq
@@ -83,4 +83,4 @@ services:
8383
DATABASE_HOST: postgres
8484
BROKER_URL: amqp://guest:guest@rabbitmq:5672/
8585
ELASTICSEARCH_URL: http://elasticsearch:9200/
86-
EMBER_SHARE_URL: http://192.168.168.167:4200
86+
EMBER_SHARE_URL: http://192.168.168.167:34200

manage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import os
33
import sys
44

5+
import django
6+
57
if os.environ.get('GEVENT') == '1':
68
from gevent import monkey
79
monkey.patch_all()
@@ -12,6 +14,11 @@
1214
if __name__ == "__main__":
1315
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
1416

17+
# Override default port for `runserver` command
18+
django.setup()
19+
from django.core.management.commands.runserver import Command as runserver
20+
runserver.default_port = "38000"
21+
1522
from django.core.management import execute_from_command_line
1623

1724
execute_from_command_line(sys.argv)

project/settings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
},
247247
]
248248

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

251251
if DEBUG:
252252
AUTH_PASSWORD_VALIDATORS = []
@@ -317,7 +317,7 @@
317317
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
318318
)
319319

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

328328
# Celery Settings
329329

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

332332
CELERY_TIMEZONE = 'UTC'
333333
CELERYBEAT_SCHEDULE = {}
@@ -472,8 +472,8 @@
472472
PUBLIC_SENTRY_DSN = os.environ.get('PUBLIC_SENTRY_DSN')
473473

474474
EMBER_SHARE_PREFIX = os.environ.get('EMBER_SHARE_PREFIX', 'share' if DEBUG else '')
475-
EMBER_SHARE_URL = os.environ.get('EMBER_SHARE_URL', 'http://localhost:4200').rstrip('/') + '/'
476-
SHARE_API_URL = os.environ.get('SHARE_API_URL', 'http://localhost:8000').rstrip('/') + '/'
475+
EMBER_SHARE_URL = os.environ.get('EMBER_SHARE_URL', 'http://localhost:34200').rstrip('/') + '/'
476+
SHARE_API_URL = os.environ.get('SHARE_API_URL', 'http://localhost:38000').rstrip('/') + '/'
477477
SHARE_WEB_URL = os.environ.get('SHARE_WEB_URL', SHARE_API_URL + EMBER_SHARE_PREFIX).rstrip('/') + '/'
478478

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

0 commit comments

Comments
 (0)