mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-25 19:14:03 +03:00
Introduce node service
This commit is contained in:
parent
a43e83fb03
commit
cd0416cf6b
11
{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev
Normal file
11
{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev
Normal 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
|
|
@ -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"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user