Automated heroku deploy from subfolder

后端 未结 3 1534
青春惊慌失措
青春惊慌失措 2021-01-30 16:57

I know you can deploy automatically to heroku from github, but I haven\'t found a way to only push a subfolder from github to heroku.

From the command-line I know it is

3条回答
  •  死守一世寂寞
    2021-01-30 17:49

    I was able to make it work. I have a server subfolder with Python Flask app and I wanted to deploy it automatically using GitHub integration.

    Heroku uses buildpacks to detect the language & framework of your project. More about that here.

    I found the source code for my buildpack here. Then you just need to look at the detection script. For python it checks the requirements.txt file, so I made a symlink using ln -s server/requirements.txt requirements.txt.

    My Procfile looks like this: web: gunicorn --pythonpath server/api app:app.

    Everything works now!

提交回复
热议问题