Skip to content

Latest commit

 

History

History
114 lines (93 loc) · 4.07 KB

File metadata and controls

114 lines (93 loc) · 4.07 KB

Contributing to WISdoM Deployment

Thank you for contributing to the deployment of the WISdoM platform. This document outlines everything you need to know to get started and to contribute effectively.

About the project

This repository contains all files required to spin up an instance of the platform. We use Docker Compose as the deployment method as it allows prebuilding the frontend and backend services on a centralized platform.

Development Tools

Docker and Docker Compose

Install Docker Engine and Docker Compose on your host as pointed out in the documentation.

Code Organization

Important Files

  • compose.yml: Base Containers always needed in a deployment
  • services.compose.yml: Definition of backend services

Adding a new service

0. Familiarize

1. Add the service to the deployment

Note

Ensure the service contains a Dockerfile or has an image available

Add an entry to the services.compose.yml file using one of the following templates. Please replace all instances of <your-service-name> with the desired service name. Also replace all <your-api-path> instances with the path under which the API of the service will be available. If the service contians an api documentation please match the API path set in the compose file with the documented base path. If the documented base path is just / then you may choose one of your liking.

Ensure that your new service definition is above the three dots at the end of the YAML file

Case 1: Service has an image available
services:
    # … all already deployed services

    <your-service-name>:
        image: <image-name>:${BACKEND_VERSION:-latest} # todo: set image name
        restart: unless-stopped
        scale: ${SERVICE_REPLICAS:-1}
        depends_on: *dbDependency
        environment: *dbEnvironment
        <<: *extraHosts
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.<your-service-name>.middlewares=<your-service-name>PrefixStrip"
            - "traefik.http.routers.<your-service-name>.rule=PathPrefix(`/<your-api-path>`)"
            - "traefik.http.middlewares.<your-service-name>PrefixStrip.stripprefix.prefixes=/<your-api-path>"
Case 2: Service has no image available
services:
    # … all already deployed services

    <your-service-name>:
        build:
            context: <the-public-http-repo-url>
            # if the Dockerfile is not in the top-level directory please specify
            # the relative path to the Dockerfile here
            # dockerfile: <relative-path-to-dockerfile>
        restart: unless-stopped
        scale: ${SERVICE_REPLICAS:-1}
        depends_on: *dbDependency
        environment: *dbEnvironment
        <<: *extraHosts
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.<your-service-name>.middlewares=<your-service-name>PrefixStrip"
            - "traefik.http.routers.<your-service-name>.rule=PathPrefix(`/<your-api-path>`)"
            - "traefik.http.middlewares.<your-service-name>PrefixStrip.stripprefix.prefixes=/<your-api-path>"

2. Validate your compose files

Tip

Create a configuration file as lined out in the installation guide to allow a smoother terminal experience

Now validate your compose files, to check for syntax errors and indent issues

docker compose convert