UNPKG

@arc-fusion/cli

Version:

CLI for running Arc Fusion on your local machine

21 lines (18 loc) 3.98 kB
# Initialization The `fusion start` process does the heavy lifting of getting all the services started to run fusion locally, while pulling in any local development resources specified by the user. Once running, local PB Editor requests are handled by the `fusion-origin` and proxied to the local `fusion-admin` and `fusion-engine` container services. The startup process consists of several functions: 1. `generate()` - creates the `docker-compose.yml` file based on command line arguments, environment variables, and the template file located at `templates/docker-compose.yml.js` 2. `down()` - shuts down orphan containers 3. `build()` - runs `docker-compose build` using either the latest fusion bundle or one specified by the user 4. `start()` - alias for `docker-compose up` # Docker Services | CONTAINER NAME | DESCRIPTION | |--------------------|---------------| | Data | This is the MongoDB service used by Editor and Engine (in localhost only). This service pulls the `washpost/mongo-vandelay` image and starts inside the `fusion-data` container using the standard mongo port 27017 | | Cache | This is the cache proxy used by engine to cache content from Content Sources. This service pulls the `redis:6.2-alpine` image and starts inside the `fusion-cache` container running on port 6379 | | Webpack | This is used to compile the React components in the customer’s bundle (features, chains, layouts, output types, content sources). This service loads the dockerfile located at `./.fusion/webpack.Dockerfile` and starts inside the `fusion-webpack` container. If a `FUSION_RELEASE` environment variable is found it is passed to the webpack container, otherwise the latest fusion release will be used. | | Engine | This is the rendering engine, which takes a Rendering object and renders HTML from the React components in the customer’s bundle. This service starts the `fusion-engine` container by pulling the `washpost/fusion-engine:\${FUSION_RELEASE:-latest}` image or if a `FUSION_REPO` environment variable has been specified, using the build context located in the local fusion repo’s `/engine` folder. The container also sets up volumes for node_modules and webpack and maps external port 9010 to port 8080 on the container as well as opening port 9229 for node inspect. Container dependencies include cache and data. | | Resolver | This service is responsible for resolving a URL to a Page/Template and a Content Source. This service starts the `fusion-resolver` container very similarly to engine. If a local fusion repo is specified, the container is built using the context found in the local fusion repo’s `/``resolver` folder, otherwise `washpost/fusion-resolver:\${FUSION_RELEASE:-latest}` is used. External port 9020 is mapped to port 8080 on the container, and if a local resolver is specified port 9021 is mapped to internal port 9229 for node inspect. | | Origin | This service is the primary point of entry into the PageBuilder stack and proxies requests to the `fusion-engine` and `fusion-admin` services respectively. The `fusion-origin` container also follows the pattern of using the local build context when a `FUSION_REPO` has been specified, otherwise the image is pulled from `washpost/fusion-origin:\${FUSION_RELEASE:-latest}`. If the `PORT` environment variable has been set it is mapped to port 8080 internally, otherwise traffic is routed over the default port 80. Port 8081 is also opened. | | Admin (optional) | This service is the backend for the PB Editor API and by default is started along with the rest of the PageBuilder stack. If the `--no-admin` flag is included in the start command, then PageBuilder Editor is not started. This service pulls the `washpost/pb-editor-api:\${PB_RELEASE:-${ADMIN_RELEASE}}` inside the container `fusion-admin` accepting traffic over port 8888. | | Fusion CLI API | This service uses `CONTENT_BASE` and `ARC_ACCESS_TOKEN` env variables to proxy to Arc services for local development. |