src/res/docker-compose.yml.ejs
# This file is associated with config/config.docker.js
#
# On windows, make sure to set the env var COMPOSE_CONVERT_WINDOWS_PATHS=1 before running
# C:\..\> set COMPOSE_CONVERT_WINDOWS_PATHS=1
# C:\..\> docker-compose -p <%-appName%> up -d
#
# Run these commands with cwd where this file is.
# To build and launch for the first time:
# $ docker-compose -p <%-appName%> up -d
# Note: -p, --project-name NAME Specify an alternate project name (default: directory name)
# To rebuild and launch add --build:
# $ docker-compose -p <%-appName%> up -d --build
# To stop containers:
# $ docker-compose stop
version: '3'
networks:
database:
driver: bridge
workers:
internal: true # plugin workers cannot access the host network
driver: bridge
services:
webgme-server:
build:
context: .
depends_on:
- mongo
environment:
- NODE_ENV=docker
networks:
- database
- workers
volumes:
# The webgme server spawns plugin-workers and need to be able to act as a docker-host.
- /var/run/docker.sock:/var/run/docker.sock
ports:
# Change LHS to map to different port on the host.
- 8888:8888
mongo:
image: mongo
## Uncomment to expose mongo-port on host
# ports:
# - 27017:27017
networks:
- database
plugin-worker:
build:
context: .
dockerfile: DockerfilePluginWorker
depends_on:
- webgme-server
networks:
- workers
environment:
- NODE_ENV=docker
command: ["cat", "/dev/null"] # A no-op command so the image is built.