Skip to content

Instantly share code, notes, and snippets.

@aredridel
Last active September 24, 2023 21:35
Show Gist options
  • Save aredridel/69e184603c1a995ce74f914fc2910350 to your computer and use it in GitHub Desktop.
Save aredridel/69e184603c1a995ce74f914fc2910350 to your computer and use it in GitHub Desktop.
Making mastodon go for development

Running a dev instance pair

tunwg --port=3000 and tunwg --port=3001 give two domain names

Init each DB: initdb -D .db0 and initdb -D .db1

Procfile.init:

postgresql: postgres -D .db$PORT_OFFSET -p 500$PORT_OFFSET
redis: redis-server --port 600$PORT_OFFSET
setup: env REDIS_PORT=600$PORT_OFFSET DB_PORT=500$PORT_OFFSET bundle exec rails db:setup

Procfile.aio:

postgresql: postgres -D .db$PORT_OFFSET -p 500$PORT_OFFSET
redis: redis-server --port 600$PORT_OFFSET
web: env PORT=300$PORT_OFFSET REDIS_PORT=600$PORT_OFFSET DB_PORT=500$PORT_OFFSET bundle exec puma -C config/puma.rb
sidekiq: env PORT=300$PORT_OFFSET REDIS_PORT=600$PORT_OFFSET DB_PORT=500$PORT_OFFSET bundle exec sidekiq
stream: env PORT=400$PORT_OFFSET REDIS_PORT=600$PORT_OFFSET DB_PORT=500$PORT_OFFSET yarn run start

Run:

RAILS_ENV=development PORT_OFFSET=0 overmind -f Procfile.init
RAILS_ENV=development PORT_OFFSET=1 overmind -f Procfile.init

Then start servers:

LOCAL_HTTPS=true LOCAL_DOMAIN=d4nme3aapjawr4o6.l.tunwg.com RAILS_ENV=development PORT_OFFSET=0 overmind start -f Procfile.aio

and

LOCAL_HTTPS=true LOCAL_DOMAIN=zh4rlxq6pwtp4khj.l.tunwg.com RAILS_ENV=development PORT_OFFSET=1 overmind start -s .overmind.sock.1 -f Procfile.aio

Those domain names are the domain names from tunwg.

Separately, run webpacker:

bin/webpack-dev-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment