使用Marathon json来创build新的实现

我们一直在探索马拉松,将其部署到docker集群中。 在应用程序体系结构中,我们有一个应用程序服务器需要访问的postgresql数据库。

在开发阶段,我们依靠fig来创builddockers之间的链接,然后使用docker强加的环境variables连接到目标(app server到postgresql)

然而,在Marathon中,我们找不到类似的方法,我们试图使用依赖关系,但是没有成功,下面是我们的Marathon.json文件

{ "id": "/project", "groups": [ { "id": "apps", "apps": [ { "id": "app", "mem": 1024, "env": { "APP_HOME": "/var/lib/app", "GIT_BRANCH": "release/2.0.0", "SETTING_FILE": "development", "BROKER_URL": "redis://redis_1:6379/0" }, "dependencies": ["database", "caching", "messaging"], "container": { "type": "DOCKER", "docker": { "image": "xxx/aok:app" } }, "volumes": [ { "containerPath": "/var/lib/app", "hostPath": ".", "mode": "RW" } ] }, { "id": "celery", "mem": 1024, "env": { "APP_HOME": "/var/lib/app", "GIT_BRANCH": "release/2.0.0", "SETTING_FILE": "development", "BROKER_URL": "redis://redis_1:6379/0" }, "container": { "type": "DOCKER", "docker": { "image": "xxx/aok:celery" } }, "volumes": [ { "containerPath": "/var/lib/app", "hostPath": ".", "mode": "RW" } ] }, { "id": "celeryhb", "mem": 1024, "env": { "APP_HOME": "/var/lib/app", "GIT_BRANCH": "release/2.0.0", "SETTING_FILE": "development", "BROKER_URL": "redis://redis_1:6379/0" }, "container": { "type": "DOCKER", "docker": { "image": "xxx/aok:celeryhb" } }, "volumes": [ { "containerPath": "/var/lib/app", "hostPath": ".", "mode": "RW" } ] } ] }, { "id": "database", "apps": [ { "id": "pg", "mem": 1024, "container": { "type": "DOCKER", "docker": { "image": "mughrabi/aok:pg" }, "volumes": [ { "containerPath": "/var/lib/postgresql/data", "hostPath": "/tmp/aok-postgres-data", "mode": "RW" } ] } } ] }, { "id": "caching", "apps": [ { "id": "redis", "mem": 1024, "container": { "type": "DOCKER", "docker": { "image": "redis" } } } ] }, { "id": "messaging", "apps": [ { "id": "rabbitmq", "mem": 1024, "container": { "type": "DOCKER", "docker": { "image": "rabbitmq" } } } ] } ] } 

有人可以请指教?