Skip to main content

Posts

Showing posts from 2017

Docker: Develop with Private Git Repositories in requirements.txt file

In trying to define my ideal Docker and Django development setup, I've been looking for a solution to the following needs: I've often found the need to install my project's private Git repositories into Docker container via a standard requirements.txt file.  I also want to easily develop on those private Git repositories, in addition to the Git repo main project repository that contains my Django project. As you've probably encountered, a standard pip requirements file for installing both pypi packages and private Git repos might look something like the following. # requirements.txt django=1.11.3 -e git+git@github.com:my_github_user/repo_1.git#egg=my_project1 -e git+git@github.com:my_github_user/repo_2.git@my_branch@egg=my_project2 If you are not using Docker and you run pip install -r requirements.txt inside of a virtualenv, pip will download pypi packages (in this case Django) into the lib/python3.x/site-packages/ directory of your virtualenv and wil

Django Docker and Celery

I've finally had the time to create a Django+Celery project that can be completely run using Docker and Docker Compose. I'd like to share some of the steps that helped me achieve this. I've created an example project that I've used to demo this process. The example project can be viewed here on Github. https://github.com/JoeJasinski/docker-django-demo/tree/blogpost To run this example, you will need to have a recent version of Docker and Docker Compose installed. I'm using Docker 17.03.1 and Docker Compose 1.11.2. Let's take a look at one of the core files, the docker-compose.yml .   You'll notice that I have defined the following services:   db - the service running the Postgres database container, needed for the Django app rabbitmq  - service running the RabbitMQ container, needed for queuing jobs submitted by Celery app  - the service containing Django app container worker  - the service that runs the Celery worker container web  - the servic