Skip to content

zachdtaylor/schmerdle-phoenix

Repository files navigation

SchmerdlePhoenix

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

Loading words data into prod

Load the word data in your local db first with

mix run priv/repo/seeds.exs

Then, create a dump of the words data with

docker exec -it postgres bash -c "pg_dump -U postgres --data-only --table=words schmerdle_phoenix_dev > db.sql"
docker cp postgres:/db.sql ~/

You should now have a db.sql file in your home directory.

Now, activate the wireguard tunnel by opening wireguard and clicking the appropriate connection.

Next, copy the db.sql file up to the db server with

cat db.sql | ssh [email protected] 'tee /db.sql'

(found here: https://community.fly.io/t/scp-a-file-into-a-persistent-volume/2729/8)

Then, ssh into the db server

From there, restore the db dump with

psql -h localhost -p 5432 -U postgres birdie < db.sql