Search code examples
herokuprocfile

Can a Procfile have comments?


Is it possible to put comments in a Procfile? If so, what is the syntax?

Not sure if this matters, but I am hosting on Heroku.


Solution

  • Yes, you can put comments in a Procfile. I know of two programs which parse Procfiles, foreman and forego.

    In foreman, which originated the Procfile format, a Procfile can contain comments, blank lines, and in fact any line that doesn't look like a meaningful Procfile line.

    From the class that parses a Procfile:

    # A valid Procfile entry is captured by this regex:
    #
    #   /^([A-Za-z0-9_]+):\s*(.+)$/
    #
    # All other lines are ignored.
    

    forego, which Heroku uses, follows the same scheme.