Tag: django

Connection refused by Docker container

I’ve struggled with this for quite some time. I have a Django application and I’m trying to package it into containers. The problem is that when I publish to a certain port (8001) the host refuses my connection. $ docker-machine ip default When I try to curl or reach by browser, the connection […]

Docker containers exiting without identifiable cause (Django web application)

I’ve taken over the maintenance of a live web project that utilizes docker containers. Immediately, I’ve noticed that the web app goes down after a couple of hours, and docker ps -a shows me: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9b02f1352f15 nginx:latest “nginx -g ‘daemon off” 9 weeks ago Exited (1) 14 hours […]

nginx doesn't forward to django app in docker-compose in ubuntu but it all works in docker-machine in Mac

I have a django backend where I use docker-compose to deploy. This django application uses a nginx proxy in the front. When I deploy it in a docker-machine and I go to the docker-machine ip I am redirected to the django site properly. But when i deploy it in a ubuntu machine on docker, when […]

can't authenticate user in postgres docker container

containerizing a django app built with the pydanny cookiecutter for deployment to an EC2 instance. the docker_compose.yml is pretty straigtforward: version: ‘2’ volumes: postgres_data: {} postgres_backup: {} services: postgres: build: ./compose/postgres volumes: – postgres_data:/var/lib/postgresql/data – postgres_backup:/backups env_file: .env …. nothing exotic in the dockefile; just pointers to backup and restore scripts and commands to make […]

Separating dependencies for Celery container from Django container

We currently have a separate Docker container for Django and Celery but they share the same root files. I was wondering if there was a way to install OpenCV in the Celery container, because we use the package in celery tasks, but not in the Django container calling the celery task. When installing OpenCV in […]

Starting postgres service in docker entry script

I am new to docker and I want to put my django website inside a docker container. I have setup the container as described here: http://michal.karzynski.pl/blog/2015/04/19/packaging-django-applications-as-docker-container-images/ I also created an entry script named entryPointScript.sh that contains the following: #!/bin/bash service postgresql start sleep 2s #sleep for two seconds source /srv/project/EnvProject/bin/activate python /srv/project/manage.py collectstatic –noinput # […]

how process static file when deploying django using docker and aws eb

I used Django, Docker and AWS Elastic Beanstalk to employ my website. I followed the instruction of https://github.com/glynjackson/django–docker-template. I met problem when I try to load static file, the browser try to visit mysite.com/static/css/xx.css to get the css and javascipt file which is different with what I run it locally. In settings.py: STATIC_URL = ‘/static/’ […]

Docker container won't run through a “CommandError:”

I am trying to follow docker example “Quickstart: Compose and Django”” found on docker docs. I get an error that I can’t solve. this is the error: CommandError: /usr/src/app/manage.py already exists, overlaying a project or app into an existing directory won’t replace conflicting files I followed the example and create Dockerfile, docker-compose.yml, requirements.txt as stated […]

Debugging silent failure in Gunicorn/NGINX/Django

I’m running a Django project with Gunicorn. I’m using Nginx as a reverse proxy. For the most part, everything works fine, but there’s one Django view that causes Gunicorn to fail silently. Details of the problem are below, but first, here’s the Django view that’s causing the problem: def jobs_all(request): if not request.user.is_superuser: raise Http404 […]

nginx app in docker not working on remote machine

I see something really weird happening, with nginx (dockerized). Here’s my conf for the same : upstream web{ ip_hash; server; } server { listen 8000; server_name localhost; location /web/ { autoindex on; alias /src/reporting/web/; } location / { proxy_pass http://web/; } } and the docker-compose.yml file : version: ‘2’ services: nginx: image: nginx:1.10.3 container_name: […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.