From 19da3c761b69124ecffa471e32044d5f49bc1fa8 Mon Sep 17 00:00:00 2001 From: Hang Sun Date: Mon, 12 Jul 2021 07:53:23 -0700 Subject: [PATCH] Support one click deployment to Heroku --- Dockerfile | 4 ++-- README.md | 2 ++ app.json | 24 ++++++++++++++++++++++++ heroku.yml | 8 ++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app.json create mode 100644 heroku.yml diff --git a/Dockerfile b/Dockerfile index c616034d..f6525678 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ COPY --from=frontend-build /commento/frontend/build/${RELEASE}/*.html /commento/ COPY --from=templates-db-build /commento/templates/build/${RELEASE}/templates /commento/templates/ COPY --from=templates-db-build /commento/db/build/${RELEASE}/db /commento/db/ -EXPOSE 8080 +EXPOSE ${COMMENTO_PORT:-$PORT} WORKDIR /commento/ ENV COMMENTO_BIND_ADDRESS="0.0.0.0" -ENTRYPOINT ["/commento/commento"] +ENTRYPOINT "COMMENTO_PORT=${COMMENTO_PORT:-$PORT} COMMENTO_POSTGRES=${COMMENTO_POSTGRES:-$DATABASE_URL} /commento/commento" diff --git a/README.md b/README.md index 6321cf3a..271955d2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ For starters, your readers value their privacy. Not caring about them is disresp Read the [documentation to get started](https://docs.commento.io/installation/). +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/adtac/commento) + #### Contributing If this is your first contribution to Commento, please go through the [contribution guidelines](https://docs.commento.io/contributing/) before you begin. If you have any questions, join [#commento on Freenode](http://webchat.freenode.net/?channels=%23commento). diff --git a/app.json b/app.json new file mode 100644 index 00000000..d2063e08 --- /dev/null +++ b/app.json @@ -0,0 +1,24 @@ +{ + "name": "Commento", + "description": "A fast, privacy-focused commenting platform.", + "repository": "https://gitlab.com/commento/commento", + "logo": "https://cdn.commento.io/images/logo.svg", + "website": "https://commento.io", + "keywords": ["goalang", "commento", "privacy"], + "stack": "container", + "addons": [ + { + "plan": "heroku-postgresql" + } + ], + "success_url": "/login", + "env": { + "COMMENTO_ORIGIN": { + "description": "This should be set to the subdomain or the IP address hosting Commento. All API requests will go to this server. This may include subdirectories if Commento is hosted behind a reverse proxy, for example. Include the protocol in the value to use HTTP/HTTPS." + }, + "COMMENTO_FORBID_NEW_OWNERS": { + "description": "Used to disable new dashboard registrations. Useful if you are the only person using Commento on your server. Does not impact the creation of accounts for your readers. Defaults to false.", + "value": "false" + } + } +} diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 00000000..901e480b --- /dev/null +++ b/heroku.yml @@ -0,0 +1,8 @@ +setup: + addons: + - plan: heroku-postgresql + as: DATABASE + +build: + docker: + web: Dockerfile \ No newline at end of file