how to create Heroku procfile for windows?
Asked Answered
R

7

12

Im a newbie trying to make a django app, but unfortunately my os is windows. Heroku docs is written for linux so I cant get sufficient information for app development on windows 7. First how can I make procfile using window cmd? Is there any command language translation docs?(linux->windows)

Romanticism answered 5/8, 2014 at 1:29 Comment(1)
I'm not sure Foreman works on Windows - also the Procfile is meant to be something that you would include in your deployments to Heroku - a windows specific one would break.Azimuth
P
16

Regarding creation of text file in cmd shell:

echo web: run this thing >Procfile

this will create Procfile with web: run this thing inside (obviously).

Also You can use any text editor, notepad will fit perfectly.

And one thing, that wasn't obvious for me, therefore can also be helpfull to someone else. Procfile should be a text file is a bit misleading, do NOT save Procfile as Procfile.txt or it will not be recognised. Just leave it plain and simple Procfile without any file format.

Palmar answered 2/5, 2015 at 20:0 Comment(0)
W
8

When you're using Windows for development, and your procfile contains for example $JAVA_OPTS (or anything else system dependent), then

  • besides of Procfile with Linux syntax (with for example: $JAVA_OPTS), for Heroku, you need
  • Procfile.windows with Windows syntax (where you can write for example" %JAVA_OPTS%), and you point to it while working with Heroku localy: heroku local web -f procfile.windows
Wunderlich answered 10/1, 2016 at 18:49 Comment(0)
B
3

A Procfile should be a text file, called Procfile, sitting in the root directory of your app.

It's the same for Windows or Linux or OS X.

It should specify the command Heroku should use to start your app - so it's not really about linux or windows.

So to answer your question: use a text editor. Any text editor.

Borderline answered 5/8, 2014 at 12:26 Comment(0)
C
2

Just create the file with name procfile. If your editor is intelligent enough as mine to understand the files like procfile have a Heroku icon

enter image description here

Clearcut answered 26/2, 2019 at 5:12 Comment(0)
K
1

gunicorn doesn't work on Windows so you'll want a Procfile.windows that will locally host your app in a way that doesn't require gunicorn (such as the way you would normally do it).

web: ~what you would normally use to start your app~

Kanter answered 28/7, 2016 at 4:32 Comment(0)
M
0

web: gunicorn app_name.wsgi
write your own application name instead of app_name and file name just save without any Extention (Procfile).

Medwin answered 21/2, 2021 at 13:2 Comment(3)
Can you please elaborate a bit more what the answer is about? Is it a command prompt? Maybe add a bit more context?Lyophobic
Write your procfile name like ( Procfile ) no need to add any type of extension and inside the Procfile write web: gunicorn app_name.wsgi. you have to write your application name instead of app_name and also install gunicorn in your project.Medwin
Makes sense. Thanks! You can simply add that to the answer and delete the comment. Makes it easier for others who might have the same problem.Lyophobic
H
0

A file named Procfile is required in the root of your Heroku project. The following is a basic example of the content to be created for a Django project:

web: gunicorn your_app_name.wsgi --log-file

Here the full docs from Heroku.

Hennery answered 21/2, 2021 at 21:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.