version: '3' volumes: api_node_modules: scripts_node_modules: dns_node_modules: networks: dref: driver: bridge services: mongo: image: mongo:3.6.5-jessie restart: on-failure networks: - dref dns: image: node:9.11.2-alpine ports: - 0.0.0.0:53:53/udp volumes: - ./dref/dns/:/src:rw - ./dref-config.yml:/tmp/dref-config.yml:ro - dns_node_modules:/src/node_modules working_dir: /src/ networks: - dref command: sh -c "npm install --production && npm run build && npm run start" restart: on-failure depends_on: - mongo scripts: image: node:9.11.2-alpine networks: - dref environment: - HOST=0.0.0.0 - PORT=8000 volumes: - ./dref/scripts/:/src:rw - scripts_node_modules:/src/node_modules working_dir: /src/ command: sh -c "npm install && npm run dev" restart: on-failure depends_on: - mongo api: build: context: . dockerfile: iptables-node-alpine.Dockerfile networks: - dref cap_add: - NET_ADMIN ports: - 0.0.0.0:80:80 - 0.0.0.0:443:443 - 0.0.0.0:8000:8000 - 0.0.0.0:8080:8080 - 0.0.0.0:8888:8888 environment: - PORT=45000 volumes: - ./dref/api/:/src:rw - ./dref-config.yml:/tmp/dref-config.yml:ro - api_node_modules:/src/node_modules working_dir: /src/ command: sh -c "npm install --production && npm run build && npm run start" restart: on-failure depends_on: - mongo - scripts