OS dependencies from requirements.apt during Docker development.
Hello! As docs says when we don't use Docker, all those requirements.apt Ubuntu 14.04 related packages are installed into activated virtualenv by executing install_os_dependencies.sh script. But I can't figure out what about docker-compose approach? When we start compose services during local development (with dev.yml) our django service uses Python 3.5 base docker image without all those OS deps. And then if we need, for example, create translations with:
docker-compose run --rm -f dev.yml django ./manage.py makemessages -l SOMELOCALE
Django cannot find gettext program installed through docker container...
Is it supposed to satisfy django-batteries os dependencies manually or I'm missing something conceptually? Maybe I'm asking a dumb question... but could you clarify it for me, please.
No, that's not a dumb question.
gettext is not in the official python image, but you can install it by adding
RUN apt-get update && apt-get install -y gettext
to Dockerfile-dev and Dockerfile.
Make sure to rebuild your containers by running docker-compose -f dev.yml build after that.
I'm not quite sure if we want to have gettext installed by default in docker. When looking at the dependencies, there are some x11 related packages as dependencies I'm not really happy about running in a container.
Is gettext only needed to run the makemessage command? If so, we could add a one-off command to the documentation that runs gettext with /app and the python runtime mounted in the container.
cc @burhan
@jayfk , can you please elaborate your suggestion on this one-off command or what would be a good workflow for makemessages on docker?
@Braintelligence, please don't hijack this issue with a completely separate issue. If you have a distinct problem, please open a new issue.
@pydanny This is strange; I typed this text originally as a new Issue but then decided to not post it at all. Now somehow this got in here and I have no idea why and how. Please ignore it, I will delete it now. I'm sorry for the inconvenience.
We now run the command to make messages as part of the test suite: https://github.com/pydanny/cookiecutter-django/blob/60ebda8bf7b0cc0c752ff813a125316d3cb79ad3/tests/test_docker.sh#L23-L24
The last bit is to add a section to the Docker documentation, under the tip & tricks: https://github.com/pydanny/cookiecutter-django/blob/master/docs/developing-locally-docker.rst#tips--tricks