haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 183 forks source link

Custom memcached service name #196

Open CS-Tao opened 4 years ago

CS-Tao commented 4 years ago

The same issue is #169. But I don't think the solution https://github.com/haiwen/seafile-docker/issues/169#issuecomment-524792259 is reasonable.

Custom memcached service name by environment :

version: '2.0'
services:
  seafile-db:
    image: mariadb:10.1
  ...

  seafile-memcached:
    image: memcached:1.5.6
  ...

  seafile:
    image: seafileltd/seafileenvi-mc:latest
    environment:
      - DB_HOST=seafile-db
      - MEM_HOST=seafile-memcached
  ...
svengreb commented 4 years ago

I've posted a workaround in https://github.com/haiwen/seafile-docker/issues/86#issuecomment-670362046 . It makes use of a Docker network alias which allows to use a custom service name for the memcached container, but ensures the hardcoded memcached host name must not be changed within the source code itself. Note that this is just a workaround and that a configuration or environment variable is still the more correct way to solve this.