Deploy Django with Docker

I am trying to deploy a django app with docker on Render but it got stuck at deploying for hours.
My Docker file reads…
FROM python:3.9
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY requirements.txt .
RUN pip install -r ./requirements.txt
COPY . /app/
EXPOSE 10000

My docker-compose reads…
version: ‘3.8’
volumes:
data:

services:
web:
build: .
command: [“python”, “manage.py”, “runserver”, ‘0.0.0.0:10000’]
ports:
- 10000:10000
volumes:
- .:/app
redis:
image: redis:latest
volumes:
- data:/data
ports:
- 6379:6379

Please, what is the problem

Hi there,

Does your Dockerfile have a CMD or ENTRYPOINT line to start it up? That’s often the cause of Docker deployments getting stuck.

If that doesn’t help just let us know.

Regards,
Mike


Render Support Engineer, MT (UTC-6)

No. The only command is the one I added to my docker-compose. My Dockerfile is exactly what I wrote in my question. And so is my docker compose. Should I add a command to my Dockerfile or… Guide me through. I will be glad. Thank you

I added an entrypoint and it’s working. Thank you

But my redis is not running with it

Render doesn’t support docker-compose. If you want to deploy a redis instance alongside your app in a docker-compose like fashion, you’ll want to use the render.yaml blueprint specification.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.