Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Heroku deployment example #1113

Closed
isaachinman opened this issue Feb 1, 2024 · 1 comment
Closed

[REQUEST] Heroku deployment example #1113

isaachinman opened this issue Feb 1, 2024 · 1 comment

Comments

@isaachinman
Copy link

I am currently trying to deploy Soketi, via the debian Docker image, to Heroku.

I am facing difficulty even getting Soketi to run on a dynamic port. I am writing a config.json file based on the dynamic run var, but no luck.

Would appreciate any examples or advice for deploying to Heroku.

@isaachinman
Copy link
Author

Figured it out, after some trial and error. For anyone in the future:

Dockerfile:

FROM quay.io/soketi/soketi:1.5.0-16-debian

COPY start.sh ./start.sh
RUN chmod +x ./start.sh

ENTRYPOINT ["./start.sh"]

start.sh

#!/bin/bash

export SOKETI_PORT=$PORT

REDIS_PASSWORD=$(echo $REDIS_URL | awk -F '[:@]' '{print $3}')
REDIS_HOST=$(echo $REDIS_URL | awk -F '[@:]' '{print $4}')
REDIS_PORT=$(echo $REDIS_URL | awk -F '[:/]' '{print $5}')
REDIS_USERNAME=$(echo $REDIS_URL | awk -F '[/@:]' '{print $3}')

export SOKETI_DB_REDIS_HOST=$REDIS_HOST
export SOKETI_DB_REDIS_PASSWORD=$REDIS_PASSWORD
export SOKETI_DB_REDIS_PORT=$REDIS_PORT
export SOKETI_DB_REDIS_USERNAME=$REDIS_USERNAME

exec node /app/bin/server.js start

heroku.yml

build:
  docker:
    web: Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant