Use nodemon to automatically restart the server in dev
This commit is contained in:
parent
ba05a5f90a
commit
89239a7c42
|
@ -1,5 +1,9 @@
|
||||||
FROM node:8
|
FROM node:8
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN yarn global add nodemon
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn --pure-lockfile
|
RUN yarn --pure-lockfile
|
||||||
COPY . .
|
COPY . .
|
|
@ -1,7 +0,0 @@
|
||||||
FROM node:8
|
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
|
||||||
RUN yarn --pure-lockfile
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
CMD ["node", "server/ingestLogs.js"]
|
|
|
@ -3,40 +3,39 @@ version: "3"
|
||||||
networks:
|
networks:
|
||||||
localnet: {}
|
localnet: {}
|
||||||
|
|
||||||
volumes:
|
|
||||||
pkgvol: {}
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
image: redis
|
image: redis
|
||||||
ports:
|
|
||||||
- "6379:6379"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
networks:
|
networks:
|
||||||
- localnet
|
- localnet
|
||||||
|
|
||||||
server:
|
server:
|
||||||
build:
|
build: .
|
||||||
context: .
|
image: server
|
||||||
dockerfile: Dockerfile.server
|
command: nodemon --ignore client server.js
|
||||||
|
env_file: .env
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
depends_on:
|
||||||
|
- cache
|
||||||
ports:
|
ports:
|
||||||
- "8080:5000"
|
- "8080:5000"
|
||||||
volumes:
|
|
||||||
- pkgvol:/packages
|
|
||||||
networks:
|
networks:
|
||||||
- localnet
|
- localnet
|
||||||
env_file: .env
|
|
||||||
depends_on:
|
|
||||||
- cache
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
build:
|
build: .
|
||||||
context: .
|
image: worker
|
||||||
dockerfile: Dockerfile.worker
|
command: nodemon --ignore client server/ingestLogs.js
|
||||||
networks:
|
|
||||||
- localnet
|
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
depends_on:
|
depends_on:
|
||||||
- cache
|
- cache
|
||||||
|
networks:
|
||||||
|
- localnet
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"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",
|
"build": "NODE_ENV=production webpack -p --json > server/stats.json",
|
||||||
"lint": "eslint client && eslint server",
|
"lint": "eslint client && eslint server",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
|
|
Loading…
Reference in New Issue