0

Recently I had my application running on cedar-14 stack in Heroku But since End-of-life window has begun and builds won't be available, I decided to use Docker, so Heroku will host Docker container with my application on cedar-14 stack as base Docker image.

So far this is my Dockerfile

FROM heroku/cedar

WORKDIR /app

COPY index.js .
COPY package.json .

But when I was using plain cedar-14 on Heroku, I also had .buildpacks, Aptfile and Procfile and these files were interpreted by Heroku environment. How can I make them work in a Docker environment now?

Arty Dev
  • 111
  • 1
  • 7

1 Answers1

0

.buildpacks, Aptfile is replaced by Dockerfile. You need to adjust your Dockerfile. Procfile is replaced by heroku.yml (see here.)

You can use cedar as your base image but I advise you to use latest LTS image and start from there.

Tin Nguyen
  • 5,250
  • 1
  • 12
  • 32
  • Got it. But how exactly should I adjust Dockerfile so these dependencies will be installed inside container? And if I need to manage everything manually in Dockerfile, why cedar stack Docker image exists afterall? Why can't we just use any other lightweight docker base image? What is the advantages of using this image provided by Heroku? – Arty Dev Apr 01 '20 at 14:44
  • Cedar (Heroku-14) is based on Ubuntu 14.04 with some Heroku specific changes. We've had Heroku-16 and are now at Heroku-18. Ubuntu 18.04 is the latest LTS image. You can use that image if you depend on that and don't want to upgrade. That image still exists for the people who created their Dockerfile years ago. But since you have to get it to work from fresh upgrading makes sense. Future deploys may stop working since at some point LTS support runs out. Ubuntu 14.04 LTS support ran out a year ago. As for the Dockerfile: Get it to run on a VPS, recreate what you did in the Dockerfile. – Tin Nguyen Apr 01 '20 at 14:53
  • Sorry, but I didn't understand what you mean For instance, without dockerized app I had several buildpacks official one and third-party ones official one is node-js they were handled by heroku environment on deployment but how can I handle them now in docker environment? I know how I can install nodejs with Dockerfile but I don't know how to handle other buildpacks with Dockerfile, so I wonder if there any way to simulate Heroky way of handling buildpacks and Aptfile – Arty Dev Apr 01 '20 at 15:06
  • For AptFile I found next trick: COPY docker/Aptfile /tmp/Aptfile RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ build-essential \ libpq-dev \ postgresql-client-$PG_MAJOR \ nodejs \ yarn=$YARN_VERSION-1 \ $(cat /tmp/Aptfile | xargs) && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ truncate -s 0 /var/log/*log, but for buildpacks I haven't found anything Could you help me with it? – Arty Dev Apr 01 '20 at 15:07