0

I'm using Coolify and I want to deploy a Django application. I created an entrypoint.sh

#!/bin/sh
set -e

echo "Running migrations..."
python manage.py migrate

echo "Collecting static files..."
python manage.py collectstatic --noinput

echo "Starting Gunicorn HTTP server..."
exec gunicorn coolify.wsgi:application --bind 0.0.0.0:8000

I have a Dockerfile and it's all connected in a docker-compose.yml file with the db. The containers are running but I keep getting a Bad Request 400 response for any endpoint.

1
  • Never used "coolify"...but Can we see your compose file and your settings for Django? What is the 400 request for, all URLs, or just your files? Commented Jul 7, 2024 at 12:47

1 Answer 1

0

Fixed it. In your Domains field for your Django application you shoud also specify the port.

So instead of https://api.yourapp.com you should add https://api.yourapp.com:8000 or the port you opened the app on.

Sign up to request clarification or add additional context in comments.

2 Comments

Do you mind sharing your full configuration e.g. Dockerfile, Docker-compose etc.? I'm trying to deploy django/react/postgres via docker-compose and run into issues especially with nginx (which I'm not sure is necessary to use as coolify has treafik).
I still have to solve that. I don't know how to let Coolify serve the static files from Django.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.