Skip to content

Commit

Permalink
Merge pull request #1148 from jokimina/port_django_from_env
Browse files Browse the repository at this point in the history
Made port used for devserver configurable
  • Loading branch information
rafalp committed Dec 20, 2018
2 parents ba864fe + 221fd8b commit 4e95b22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NORMAL=$(tput sgr0)

# Required ports
# Some tasks test for those ports before continuing
port_django=8000
port_django=${MISAGO_DEVSERVER_PORT:-8000}
port_postgresql=5432

required_ports=($port_postgresql $port_django)
Expand Down Expand Up @@ -106,7 +106,7 @@ init() {
nc "127.0.0.1" "$port" < /dev/null
if [[ $? = "0" ]]; then
if [[ $port = $port_django ]]; then
error "Other application appears to already be running on http://127.0.0.1:8000"
error "Other application appears to already be running on http://127.0.0.1:${port_django}"
elif [[ $port = $port_postgresql ]]; then
error "PostgreSQL appears to already be running on the port $port."
echo
Expand Down Expand Up @@ -145,7 +145,7 @@ after_init_message() {
echo
echo " docker-compose up"
echo
echo "Running server will be available in the browser under the http://127.0.0.1:8000 address."
echo "Running server will be available in the browser under the http://127.0.0.1:${port_django} address."
echo
echo "Default superuser has been created with this username and password:"
echo
Expand Down Expand Up @@ -316,4 +316,4 @@ if [[ $1 ]]; then
fi
else
intro
fi
fi
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
ports:
# Map port 8000 in the container to port 8000 on the host
# This way we can access the forum through http://localhost:8000
- "8000:8000"
- "${MISAGO_DEVSERVER_PORT:-8000}:8000"
depends_on:
- postgres
tty: true
Expand Down

0 comments on commit 4e95b22

Please sign in to comment.