Skip to content

Run CORD locally with Docker

Carson Full edited this page Jul 7, 2021 · 5 revisions

Setup (one time)

Save this as docker-compose.yml:

version: '3.7'
services:

  ui:
    image: 'ghcr.io/seedcompany/cord/ui:${UI_TAG:-latest}'
    ports:
      - '${UI_PORT:-3001}:80'
    depends_on:
      - api
    environment:
      RAZZLE_API_BASE_URL: http://localhost:${API_PORT:-3000}

  api:
    image: 'ghcr.io/seedcompany/cord/api:${API_TAG:-latest}'
    ports:
      - '${API_PORT:-3000}:80'
    networks:
      - cord
    depends_on:
      - db
    environment:
      NEO4J_URL: bolt://db:7687
      NEO4J_USERNAME: neo4j
      NEO4J_PASSWORD: admin
      PUBLIC_PORT: ${API_PORT:-3000}

  db:
    image: ghcr.io/seedcompany/cord-procedures
    ports:
      - 7474:7474
      - 7687:7687
    networks:
      - cord
    environment:
      NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
      NEO4J_AUTH: neo4j/admin
      NEO4JLABS_PLUGINS: '["apoc"]'

networks:
  cord:

Running (everytime)

Run this to download the latest code. (in the same folder you put that file above)

docker-compose pull

Run this to start CORD

docker-compose up

View UI: http://localhost:3001
View API GraphQL browser: http://localhost:3000/graphql
View DB browser: http://locahost:7474

To stop the process use the keyboard shortcut Control + C

Customize

Production version is configured by default.

To use the dev env create a .env file next to the docker-compose.yml file.
Define the TAG to use as dev. (Default is latest which is production by Docker convention.)

UI_TAG=dev
API_TAG=dev

Additionally if you want to change the ports the UI/API run at you can set them here as well

UI_PORT=4321
API_PORT=9999

Pull Requests

PRs can also be built & published to the Docker registry. Simply add the build-it label to the PR and GitHub will build & publish it for you. After it's done you can pull it down by changing the tag requested, like this:

UI_TAG=pr-1234