Introduce node service

This commit is contained in:
Nikita P. Shupeyko 2017-04-21 14:06:23 +03:00
parent a43e83fb03
commit cd0416cf6b
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,11 @@
FROM node:7.7-slim
RUN mkdir -p /app
COPY ./package.json /app
WORKDIR /app
RUN npm install && npm cache clean
ENV PATH ./node_modules/.bin/:$PATH

View File

@ -21,6 +21,7 @@ services:
depends_on: depends_on:
- postgres{% if cookiecutter.use_mailhog == 'y' %} - postgres{% if cookiecutter.use_mailhog == 'y' %}
- mailhog{% endif %} - mailhog{% endif %}
- node
environment: environment:
- POSTGRES_USER={{cookiecutter.project_slug}} - POSTGRES_USER={{cookiecutter.project_slug}}
- USE_DOCKER=yes - USE_DOCKER=yes
@ -48,3 +49,19 @@ services:
ports: ports:
- "8025:8025" - "8025:8025"
{% endif %} {% endif %}
node:
build:
context: .
dockerfile: ./compose/node/Dockerfile-dev
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"