diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index e9dc0a3df..b3c12b4c1 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -47,6 +47,9 @@ on your development system:: If you want to build the production environment you use ``production.yml`` as -f argument (``docker-compose.yml`` or ``docker-compose.yaml`` are the defaults). +.. _devlocdocker-boot-the-system: + + .. _devlocdocker-boot-the-system: Boot the System diff --git a/{{cookiecutter.project_slug}}/compose/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/node/Dockerfile new file mode 100644 index 000000000..e53fb5049 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/node/Dockerfile @@ -0,0 +1,11 @@ +FROM node:7.10-slim + +RUN mkdir -p /app + +COPY ./package.json /app + +WORKDIR /app + +RUN npm install && npm cache clean + +ENV PATH ./node_modules/.bin/:$PATH diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 8613ea5b3..ed16120fa 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -49,3 +49,18 @@ services: ports: - "8025:8025" {% endif %} + + node: + build: + context: . + dockerfile: ./compose/node/Dockerfile + volumes: + - .:/app + # http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html + - /app/node_modules + command: "gulp" + ports: + # BrowserSync port. + - "3000:3000" + # BrowserSync UI port. + - "3001:3001" diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index af54b4442..42aa1a62a 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -19,6 +19,7 @@ services: depends_on: - postgres - redis + - node command: /gunicorn.sh env_file: .env @@ -76,3 +77,9 @@ services: - redis command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO {% endif %} + + node: + extends: + service: node + file: ./dev.yml + ports: []