【发布时间】:2017-07-04 10:13:24
【问题描述】:
我有以下 docker compose 文件:
version: '2'
services:
app:
build: .
command: >
bash -cex "
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
/virtualenv/bin/flask run -h 0.0.0.0 -p 5050
"
env_file: env
links:
- postgres
ports:
- 8080:8080
如您所见,我正在使用 env_file 选项从文件 env 加载我的环境变量。
现在我正在尝试将此容器部署到 Elastic Beanstalk。 到目前为止,这是我的文件 Dockerrun.aws.json:
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "app",
"image": "myorg/myimage",
"essential": true,
"memory": 256,
"command": [
"/bin/bash",
"export LC_ALL=C.UTF-8",
"export LANG=C.UTF-8",
"/virtualenv/bin/flask run -h 0.0.0.0 -p 5050"
],
"portMappings": [
{
"hostPort": 8080,
"containerPort": 8080
}
],
"links": [
"postgres",
]
}
在 AWS Elastic Beanstalk documentation 中仅提及 environment 选项以传递一组 env 变量,但我找不到如何传递文件而不是变量数组。
有人知道如何将这个 docker-compose 文件正确翻译成 Dockerrun.aws.json 文件吗?
问候。
【问题讨论】:
标签: amazon-web-services docker amazon-elastic-beanstalk docker-compose