Docker Community Forums

Share and learn in the Docker community.

Gettting 502 nginx eoor while ruuning a django application within a container


(Sidhartha03) #1

I have manually created the docker image which is having all the setup to run Django application (I haven’t created it using Dockerfile).

Those are the following steps I am following to run my application within a docker container .

docker run -i -t -d -p 8000:8000 c4ba9ec8e613 /bin/bash
docker attach c4ba9ec8e613

my start up script :

#activate virtual env
echo Activate vitualenv.
source /home/my_env/bin/activate

#restart nginx
echo Restarting Nginx
service nginx restart

Start Gunicorn processes

echo Starting Gunicorn.
gunicorn OPC.wsgi:application --bind= --daemon

This setup is working fine in the local machine but not working within the docker .