diff --git a/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev b/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev new file mode 100644 index 00000000..926c89f2 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev @@ -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 diff --git a/{{cookiecutter.project_slug}}/dev.yml b/{{cookiecutter.project_slug}}/dev.yml index 122dea44..7a2d06eb 100644 --- a/{{cookiecutter.project_slug}}/dev.yml +++ b/{{cookiecutter.project_slug}}/dev.yml @@ -21,6 +21,7 @@ services: depends_on: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} + - node environment: - POSTGRES_USER={{cookiecutter.project_slug}} - USE_DOCKER=yes @@ -48,3 +49,19 @@ services: ports: - "8025:8025" {% 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" +