diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 19c24f8e5..f540dfc55 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -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 --------------- diff --git a/docs/index.rst b/docs/index.rst index bfa88f18c..7abdf0888 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,7 @@ Contents: developing-locally-docker settings linters + nodejs-with-docker live-reloading-and-sass-compilation deployment-on-pythonanywhere deployment-on-heroku diff --git a/docs/nodejs-with-docker.rst b/docs/nodejs-with-docker.rst new file mode 100644 index 000000000..7b1a70338 --- /dev/null +++ b/docs/nodejs-with-docker.rst @@ -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