Skip to content

Add Docker/Docker-Compose configuration to every integration #199

@brunoocasali

Description

@brunoocasali

The idea is to create a standard way to use docker in the integration team's repositories.

The implementation should contain at least*:

  • A service called meilisearch of course!
  • A service called package (this name is not defined yet, some options, lib, src, package, repo, app, source, sdk, integration, needs to work for every integration).
    • In the main service we should have links to the meilisearch service, to be possible to access http://meilisearch:7700.
    • We should be able to avoid downloading multiple times the same dependency, volumes could prevent it.
  • The meilisearch service should point to latest tag.
  • The meilisearch service should have environment item - MEILI_NO_ANALYTICS="true"
  • The base image should be based on only one distro, debian/ubuntu.
  • The code of the SDK must respect an environment flag with the host of meilisearch could be eg. MEILISEARCH_HOST, MEILISEARCH_URL and not define directly localhost:7700 as usual.
  • If the code relies on an API KEY, you can define the environment flag as MEILISEARCH_API_KEY.
  • If the setup requires a docker entry point it should be called docker-entrypoint.sh.
Click to see an example for the ruby SDK
version: "3.8"

volumes:
  bundle:

services:
  package:
    image: ruby:3.0
    tty: true
    stdin_open: true
    working_dir: /home/package
    environment:
      - MEILISEARCH_HOST=meilisearch
      - MEILISEARCH_PORT=7700
      - BUNDLE_PATH=/vendor/bundle
    volumes:
      - ./:/home/package
      - bundle:/vendor/bundle
    links:
      - meilisearch

meilisearch:
 image: getmeili/meilisearch:latest
 ports:
   - "7700"
 environment:
   - MEILI_MASTER_KEY=masterKey
   - MEILI_NO_ANALYTICS=true

Problems we still don't know how to solve

How do we prevent container name conflicts?

Error response from daemon: Conflict. The container name "/meilisearch" is already in use by container "a5aa500212bd3325a6d8a0099c7a750c292661850b640a5b140b7369cccac051". You have to remove (or rename) that container to be able to reuse that name.

Re) Remove all the container_name from the meilisearch service and add the links: ['meilisearch'] to the package service.

How do we prevent port conflicts?

Error response from daemon: driver failed programming external connectivity on endpoint meilisearch (4af35bd1b1b9c7df119a01470c4d91dcbe02c3f4dd73b6b8df142ec94f02b988): Bind for 0.0.0.0:7700 failed: port is already allocated

Re) Just use ports: ['7700'] without caring with both in and out like ports: ['7700:7700']

Is possible to have only one meilisearch instance running?

Also, this is a good thing, or it could lead to other bugs?

*PS: The docker-compose could have more services, but these two are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneed discussionNeed discussion to make a decision

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions