mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-06 05:00:18 +03:00
Document Node.js-Docker integration
This commit is contained in:
parent
a55f4c23be
commit
84a95eb85b
|
@ -6,6 +6,8 @@ Getting Up and Running Locally With Docker
|
|||
The steps below will get you up and running with a local development environment.
|
||||
All of these commands assume you are in the root of your generated project.
|
||||
|
||||
.. _devlocdocker-prereq:
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
|
@ -30,6 +32,9 @@ Currently PostgreSQL (``psycopg2`` python package) is not installed inside Docke
|
|||
|
||||
Doing this will prevent the project from being installed in an Windows-only environment (thus without usage of Docker). If you want to use this project without Docker, make sure to remove ``psycopg2`` from the requirements again.
|
||||
|
||||
|
||||
.. _devlocdocker-build-the-stack:
|
||||
|
||||
Build the Stack
|
||||
---------------
|
||||
|
||||
|
@ -40,6 +45,9 @@ on your development system::
|
|||
|
||||
If you want to build the production environment you don't have to pass an argument -f, it will automatically use docker-compose.yml.
|
||||
|
||||
|
||||
.. _devlocdocker-boot-the-system:
|
||||
|
||||
Boot the System
|
||||
---------------
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ Contents:
|
|||
developing-locally-docker
|
||||
settings
|
||||
linters
|
||||
nodejs-with-docker
|
||||
live-reloading-and-sass-compilation
|
||||
deployment-on-pythonanywhere
|
||||
deployment-on-heroku
|
||||
|
|
41
docs/nodejs-with-docker.rst
Normal file
41
docs/nodejs-with-docker.rst
Normal file
|
@ -0,0 +1,41 @@
|
|||
Node.js with Docker
|
||||
===================
|
||||
|
||||
.. index:: node, nodejs, docker, docker-compose
|
||||
|
||||
`Node.js`_ support is provided out-of-the-box, ready for use as-is, or with any kind of customizations suiting the specific needs of the project.
|
||||
|
||||
.. _`Node.js`: https://nodejs.org/en/
|
||||
|
||||
*Note, all paths given are relative to the generated project's root.*
|
||||
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
- The project was generated with :code:`use_docker` set to :code:`y`.
|
||||
- These :ref:`devlocdocker-prereq` are met as well.
|
||||
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
Essential aspects of integration are
|
||||
|
||||
- node docker-compose service (:code:`node`) definition in :code:`./dev.yml`;
|
||||
- :code:`./compose/node/Dockerfile-dev` defining the :code:`node` image;
|
||||
- :code:`./node_modules/` 'overlayed' with :code:`/app/node_modules/`, its counterpart from the running instance of :code:`node`.
|
||||
|
||||
|
||||
Workflow
|
||||
--------
|
||||
|
||||
#. :ref:`devlocdocker-build-the-stack`:
|
||||
- when building :code:`node` image from scratch, dependencies from :code:`package.json` are installed.
|
||||
#. :ref:`devlocdocker-boot-the-system`.
|
||||
|
||||
To log the running :code:`node` container's activity,
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker-compose -f dev.yml logs node
|
Loading…
Reference in New Issue
Block a user