Skip to content

Commit

Permalink
Improve docs and template files following real use
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurty committed Mar 6, 2018
1 parent cc1f955 commit 23205f3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ To create a new project from the template:
To upgrade an existing ``ixc-django-docker`` project with the currently
installed version of the template:

# TODO This command does not yet exist
$ manage.py update_ixc_django_docker_project_template

Otherwise, see `How to dockerize an existing project`_.
Otherwise, see `How to dockerize an existing project <docs/how-tos.rst>`

See the `Django project template <docs/project-template.rst>`_ documentation
for more details.
Expand Down Expand Up @@ -131,6 +132,10 @@ The main drawback is that it can be significantly slower on macOS due to
performance issues with ``osxfs`` shared volumes. See:
https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/1

Build or re-build the project's Docker container::

This comment has been minimized.

Copy link
@mrmachine

mrmachine Mar 6, 2018

Collaborator

This command builds an image, not a container. docker-compose run runs a container in the context of an image (file system isolation). You might also want to add --pull which ensures any base images (e.g. buildpack-deps:xenial) are updated first, when updates are available.


$ docker-compose build

Run an interactive shell::

$ docker-compose run --rm --service-ports bash
Expand Down
26 changes: 25 additions & 1 deletion docs/how-tos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,41 @@ as `PYENVD_HOST` to establish a connection from the container to PyCharm.
How to dockerize an existing project
====================================

* Rename ``requirements.txt`` to ``requirements.in``.
* Rename ``requirements.txt`` to ``requirements.in`` and trim the contents down
to only the specific project requirements you need to specify; the rest of
the project requirements will be populated into ``requirements.txt`` by
``pip-compile``

* Include in ``requirements.in`` a reference to this project along with all the
supporting features you will use, for example::

ixc-django-docker[postgres,sentry,whitenoise,storages,compressor,celery,celery-email]

**NOTE:** See this project's ``setup.py`` for a list of potential extra
modules.

* Add to, or update all files in, your project directory with changes from the
corresponding files in the ``project_template`` directory.

* Be sure to replace all occurrences of ``project_template`` in these copied
files with your project name.


* Configure environemnt variables

* Create an ``.env.local`` file and set at least the ``DOTENV`` and
``TRANSCRYPT_PASSWORD`` variables

* Install ``pip-tools``::

$ pip install pip-tools

* Run ``pip-compile -v``, resolving any conflicts that may arise.

* Re-derive your ``requirements.txt`` file from ``requirements.in`` with::

$ pip-compile --output-file requirements.txt requirements.in

This comment has been minimized.

Copy link
@mrmachine

mrmachine Mar 6, 2018

Collaborator

This is not necessary. You can just re-run pip-compile -v to regenerate requirements.in. Those arguments you have specified are the defaults.

* Make ``go.sh`` executable::

$ chmod 755 go.sh
Expand Down
4 changes: 3 additions & 1 deletion project_template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
**/pubring.gpg~
**/random_seed
**/requirements-local.txt
/.gnupg/gpg.conf
/.coverage
/.env.local
/.idea/
/.gnupg/gpg.conf
/bower_components/
/docker-compose.override.yml
/node_modules/
Expand Down
1 change: 1 addition & 0 deletions project_template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "project_template",
"dependencies": {
"bower": "^1.8.2"
},
"private": true
}
4 changes: 2 additions & 2 deletions project_template/project_settings.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# See ``ixc_django_docker/settings/__init__.py`` for details on how base and
# project settings are combined.
# See https://github.com/ixc/ixc-django-docker/README.rst#composable-settings
# for details on how base and project settings are combined.

0 comments on commit 23205f3

Please sign in to comment.