memos icon indicating copy to clipboard operation
memos copied to clipboard

Question: deploying on Heroku

Open maciej-ka opened this issue 1 year ago • 1 comments

Has anyone succeeded in deploying on Heroku? I tried like this:

  1. Setup Heroku project
heroku login
heroku create my-memos
heroku stack:set container -a my-memos
  1. Add heroku.yml file in the root of the project
build:
  docker:
    web: Dockerfile
run:
  web: docker run -d -p $PORT:5230 -v ~/.memos/:/var/opt/memos ghcr.io/usememos/memos:latest
  1. Commit that file and trigger deployment
git checkout heroku-deployment
heroku git:remote -a my-memos
git add .
git commit -m "chore: heroku deployment"
git push heroku heroku-deployment:master
heroku open
heroku logs --tail

Here I check the logs and see:

2023-08-05T11:48:31.032385+00:00 heroku[web.1]: Starting process with command `/bin/sh -c docker\ run\ -d\ -p\ \13630:5230\ -v\ \~/.memos/:/var/opt/memos\ ghcr.io/usememos/memos:latest`
2023-08-05T11:48:31.897261+00:00 app[web.1]: Error: unknown command "/bin/sh" for "memos"
2023-08-05T11:48:31.897288+00:00 app[web.1]: Run 'memos --help' for usage.
2023-08-05T11:48:31.899332+00:00 app[web.1]: panic: unknown command "/bin/sh" for "memos"
2023-08-05T11:48:31.899333+00:00 app[web.1]:
2023-08-05T11:48:31.899335+00:00 app[web.1]: goroutine 1 [running]:
2023-08-05T11:48:31.899352+00:00 app[web.1]: main.main()
2023-08-05T11:48:31.899361+00:00 app[web.1]: /backend-build/main.go:12 +0x45
2023-08-05T11:48:32.014578+00:00 heroku[web.1]: Process exited with status 2
2023-08-05T11:48:32.040258+00:00 heroku[web.1]: State changed from starting to crashed

Where root reasons seem to be unknown command "/bin/sh" for "memos"

Any hints on what extra is needed to deploy?

maciej-ka avatar Aug 05 '23 12:08 maciej-ka

Have you solved the problem? I've similar question when running "Setup the environments" following https://www.usememos.com/docs/contribution/development , using cmd docker compose run api go install github.com/cosmtrek/air@latest, the log is:

Error: unknown command "go" for "memos"
Run 'memos --help' for usage.
panic: unknown command "go" for "memos"

goroutine 1 [running]:
main.main()
	/work/main.go:13 +0x38

maybeluo avatar Nov 13 '23 17:11 maybeluo