Use nodemon to automatically restart the server in dev

This commit is contained in:
Michael Jackson 2018-07-05 17:08:37 -07:00
parent ba05a5f90a
commit 89239a7c42
4 changed files with 22 additions and 26 deletions

View File

@ -1,5 +1,9 @@
FROM node:8
WORKDIR /app
RUN yarn global add nodemon
COPY package.json yarn.lock ./
RUN yarn --pure-lockfile
COPY . .

View File

@ -1,7 +0,0 @@
FROM node:8
COPY package.json yarn.lock ./
RUN yarn --pure-lockfile
COPY . .
CMD ["node", "server/ingestLogs.js"]

View File

@ -3,40 +3,39 @@ version: "3"
networks:
localnet: {}
volumes:
pkgvol: {}
services:
cache:
image: redis
ports:
- "6379:6379"
volumes:
- ./data:/data
ports:
- "6379:6379"
networks:
- localnet
server:
build:
context: .
dockerfile: Dockerfile.server
build: .
image: server
command: nodemon --ignore client server.js
env_file: .env
volumes:
- .:/app
depends_on:
- cache
ports:
- "8080:5000"
volumes:
- pkgvol:/packages
networks:
- localnet
env_file: .env
depends_on:
- cache
worker:
build:
context: .
dockerfile: Dockerfile.worker
networks:
- localnet
build: .
image: worker
command: nodemon --ignore client server/ingestLogs.js
env_file: .env
volumes:
- .:/app
depends_on:
- cache
networks:
- localnet

View File

@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"start": "echo 'Use `docker-compose up` to start the server",
"start": "docker-compose up",
"build": "NODE_ENV=production webpack -p --json > server/stats.json",
"lint": "eslint client && eslint server",
"test": "jest"