-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make dumpus API easier to self-host #48
base: main
Are you sure you want to change the base?
Conversation
Also! A note: I did attempt to include flower in the docker-compose, but I ultimately commented it out, since it required me to make changes to |
Thank you for your PR, I will review this as soon as possible! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great PR, although there are some minor things from the cherry tree that I feel should be acknowledged. Thank you for this, I was also stuck on getting the API up and going!
docker-compose.yml
Outdated
environment: | ||
RABBITMQ_DEFAULT_USER: dumpus | ||
RABBITMQ_DEFAULT_PASS: dumpus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it would be better if you used environment variables instead of hard coding usernames and passwords 😅
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
docker-compose.yml
Outdated
dockerfile: Dockerfile.worker | ||
|
||
healthcheck: | ||
test: [ "CMD-SHELL", "celery", "-A", "tasks", "inspect", "ping", "-d", "regular_process@$HOSTNAME" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test: ["CMD-SHELL", "celery -A tasks inspect ping -d regular_process@$$HOSTNAME"]
This is a better way to implement the health check because the command isn't split into multiple arguments but rather a single shell command.
docker-compose.yml
Outdated
RABBITMQ_DEFAULT_USER: dumpus | ||
RABBITMQ_DEFAULT_PASS: dumpus | ||
|
||
restart: unless-stopped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider on-failure in case of an error
docker-compose.yml
Outdated
POSTGRES_PASSWORD: dumpus | ||
POSTGRES_DB: dumpus | ||
|
||
restart: unless-stopped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider on-failure in case of an error
docker-compose.yml
Outdated
retries: 5 | ||
|
||
environment: | ||
POSTGRES_USER: dumpus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing as the first comment, use environment variables
docker-compose.yml
Outdated
environment: | ||
POSTGRES_URL: "postgresql+psycopg2://dumpus:dumpus@db:5432/dumpus" | ||
RABBITMQ_URL: "amqp://dumpus:dumpus@broker:5672/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to update the connection strings
docker-compose.yml
Outdated
environment: | ||
POSTGRES_URL: "postgresql+psycopg2://dumpus:dumpus@db:5432/dumpus" | ||
RABBITMQ_URL: "amqp://dumpus:dumpus@broker:5672/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to update the connection strings
db: | ||
container_name: dumpus-db | ||
image: postgres:latest | ||
ports: | ||
- "6641:5432" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a volume here would be useful for database persistence
db:
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
@Priultimus, can I apply the suggested changes via a PR to your fork? just wanna make sure that's okay with you :D |
Thank you for your review work @builtbyvys |
The issues I was encountering were just missing context when it came to deploying this, and an absence of documentation overall. I understood it when I saw the PR, and got up and running shortly after successfully. Good project though, thank you for your work! |
@builtbyvys Yeah that would be great, thanks! |
fixed up changes according to review
just bumping due to inactivity, this should be ready to merge! |
Thank you, I will review this asap! |
Hello! I like your project, and I was trying to self host the API. I wasn't able to find great documentation on how to use caprover, so I figured I'd use Docker. It was pretty easy, so I thought I'd add a
docker-compose.yml
file to the project, just to save any others who might pass by some time.I also took a look at your project diswho, and it looked like it was just a wrapper around making a GET request to Discord. I figured, you could also add the option to use your own Discord secret and have the API make a request directly to Discord rather than installing a whole other project just to do so.
Now, to install, you only have to install docker, put a
DISCORD_SECRET
orDISWHO_BASE_URL
andDISWHO_JWT_SECRET
into your.env
, and then rundocker-compose build && docker-compose up
and it should just work :)Hopefully this doesn't break anything! 😅 Thank you for your time, and I do really like the project.