-
Notifications
You must be signed in to change notification settings - Fork 58
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
base: develop
Are you sure you want to change the base?
[SHARE-746][Improvement] Change ports for rabbitmq, postgres, and elasticsearch #629
Conversation
docker-compose.yml
Outdated
|
||
web: | ||
build: . | ||
command: python manage.py runserver --noreload 0.0.0.0:8000 | ||
command: python manage.py runserver --noreload 0.0.0.0:38000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? You've told the server in the container to run on port 38000 but you're forwarding the host's port 8000 in the container still.
docker-compose.yml
Outdated
BROKER_URL: amqp://guest:guest@rabbitmq:5672/ | ||
SHARE_API_URL: http://web:8000/ | ||
ELASTICSEARCH_URL: http://elasticsearch:9200/ | ||
BROKER_URL: amqp://guest:guest@rabbitmq:35672/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this need to be kept as the default port? The actual connection should be happening inside the container.
manage.py
Outdated
# Override default port for `runserver` command | ||
django.setup() | ||
from django.core.management.commands.runserver import Command as runserver | ||
runserver.default_port = "38000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very hacky. Could you overwrite the runserver command with your own and then just subclass it?
e3acb86
to
6191a3b
Compare
cc15ee1
to
4847a89
Compare
@aaxelb, conflicts resolved. The docs/ |
Purpose
Make it easier to have both SHARE and the OSF running locally.
Changes
Added 30,000 to all SHARE services ports:
5432
-->35432
9200
-->39200
5672
-->35672
4200
-->34200
To run the server locally (not in docker):
python manage.py runlocalserver
instead ofpython manage.py runserver
.To run the server locally (not in docker) would need to set a local env var to make'PORT': os.environ.get('DATABASE_PORT', '5432'),
35432
insettings.py
. And runpython manage.py runlocalserver
instead ofpython manage.py runserver
.Related PR: CenterForOpenScience/ember-share#191
This could be done in other ways:
Side effects
Need to make sure all environment variables are defined on staging/production.
Will require some changes to staging/production. Also changes to quay images.Could just have a separate docker-compose.yml for local though?Ticket
https://openscience.atlassian.net/browse/SHARE-746