Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gambinish/66fc49ebc5fe52a1c7a19dc99df71326 to your computer and use it in GitHub Desktop.
Save gambinish/66fc49ebc5fe52a1c7a19dc99df71326 to your computer and use it in GitHub Desktop.

Revisions

  1. @nathanpanics nathanpanics revised this gist Oct 26, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-heroku-deployment.md
    Original file line number Diff line number Diff line change
    @@ -53,4 +53,4 @@ heroku container:rm <image name>
    ```

    ## Resources
    [Container Runtime & Registry](https://devcenter.heroku.com/articles/container-registry-and-runtime)
    [Heroku - Container Runtime & Registry](https://devcenter.heroku.com/articles/container-registry-and-runtime)
  2. @nathanpanics nathanpanics created this gist Oct 26, 2018.
    56 changes: 56 additions & 0 deletions docker-heroku-deployment.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    # Deploying Docker-Compose Container to Heroku

    ## Requirements
    - [node.js](https://nodejs.org/en/)
    - [docker & docker-compose](https://docs.docker.com/compose/install/#prerequisites)
    - [heroku cli](https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up)
    - [compose-it](https://www.npmjs.com/package/compose-it)
    - [heroku account](https://signup.heroku.com/dc)

    ## Set Up Environment

    1. Generate docker-compose react template
    ```bash
    npx compose-it -u <username> -d <project name>
    ```

    2. Test docker-compose locally. Check http://localhost:3000
    ```bash
    docker-compose up
    ```

    3. (optional if already logged in) Log in to Heroku
    ```bash
    heroku container:login
    ```

    ## Deployment

    ```bash
    # app name is optional, heroku will randomly pick a name if no name is given
    heroku create [app name]

    # build image and push to container registry
    heroku container:push <image name>

    # release the image to your app
    heroku container:release <image name>

    # open the app in your browser
    heroku open
    ```

    ## Updating images

    ```bash
    heroku container:push <image name>
    ```

    ## Removing images

    ```bash
    heroku container:rm <image name>
    ```

    ## Resources
    [Container Runtime & Registry](https://devcenter.heroku.com/articles/container-registry-and-runtime)