How to run softinstigate/restheart on Heroku

  • Modifié il y à8 mois 
  • Temps de lecture :1Minute

We will create a custom Dockerfile and assign the Heroku $ PORT environment variable to the restheart HTTP_PORT environment variable.

Restheart :

Running insctructions with Docker :

The original Dockerfile :

FROM adoptopenjdk:16-jre-hotspotLABEL maintainer="SoftInstigate <>"
WORKDIR /opt/restheart
COPY etc/restheart.yml etc/ etc/acl.yml etc/users.yml etc/
COPY target/restheart.jar /opt/restheart/
COPY target/plugins/* /opt/restheart/plugins/
ENTRYPOINT [ "java", "-Dfile.encoding=UTF-8", "-server", "-jar", "restheart.jar", "etc/restheart.yml"]
CMD ["--envFile", "etc/"]
EXPOSE 8009 8080 4443

Dockerfile updated :

The important line here is :

ENTRYPOINT [“java”,"-DHTTP_PORT=$PORT", “-Dfile.encoding=UTF-8”, “-server”, “-jar”, “restheart.jar”, “etc/restheart.yml”].

# <>
FROM softinstigate/restheart:6.1.2
ENTRYPOINT ["java","-DHTTP_PORT=$PORT", "-Dfile.encoding=UTF-8", "-server", "-jar", "restheart.jar", "etc/restheart.yml"]
CMD [ "--envFile", "etc/"]
COPY /restheart.yml /opt/restheart/etc/restheart.yml
COPY / /opt/restheart/etc/
COPY /acl.yml /opt/restheart/etc/acl.yml
COPY /users.yml /opt/restheart/etc/users.yml

Other environment variables like MONGO_URI can be configured in Dashboard> Settings> Config Vars.

Now you can follow the heroku tutorial to deploy with Docker :

Laisser un commentaire