Skip to content

Commit 7e6c7a8

Browse files
committed
Start exposing Ghost on localhost and template port
no ref - The thinking here is this allows users to more easily run multiple Ghost instances on the same server by templating the Ghost port - Majority wont need this but it also simplifies the message around having to forward traffic if you don't start Caddy
1 parent 3a0ebc8 commit 7e6c7a8

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ DATABASE_ROOT_PASSWORD=reallysecurerootpassword
1313
DATABASE_USER=optionalusername
1414
DATABASE_PASSWORD=ghostpassword
1515

16+
# Port Ghost should listen on
17+
# You should only need to edit this if you want to host
18+
# multiple sites on the same server
19+
# GHOST_PORT=2368
20+
1621
# Developer Experiences must be enabled for
1722
# both Traffic Analytics and ActivityPub
1823
ENABLE_DEVELOPER_EXPERIMENTS=false

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
image: ghost:${GHOST_VERSION:-5-alpine}
2424
restart: always
2525
expose:
26-
- "2368"
26+
- "127.0.0.1:${GHOST_PORT:-2368}:2368"
2727
# This is required to import current config when migrating
2828
env_file:
2929
- .env

scripts/migrate.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,11 @@ main() {
509509
echo "✓ Caddy Webserver is running!"
510510
echo "✓ Your site is available at: https://${domain}"
511511
else
512+
local ghost_port
513+
ghost_port=$(grep 'GHOST_PORT' "${PWD}/.env" | cut -d '=' -f 2)
512514
echo ""
513-
echo "✓ Ghost is running on port 2368"
514-
echo " Configure your reverse proxy to forward traffic to it"
515+
echo "✓ Ghost is now running"
516+
echo " To finish migration, configure your webserver to forward traffic to 127.0.0.1:${ghost_port}"
515517
fi
516518

517519
# Success! Remove recovery script

0 commit comments

Comments
 (0)