"AWSEBDockerrunVersion": 2, //aws eb docker 版本號
"volumes": [ //要對應 docker-compose.yml 的 contianer 的 volume設定
{
"name": "app-api",
"host": {
"sourcePath": "/var/app/current/api" //外部mapping到那裡
}
},
{
"name": "app-ui",
"host": {
"sourcePath": "/var/app/current/ui"
}
},
{
"name": "nginx-proxy-conf",
"host": {
"sourcePath": "/var/app/current/proxy/conf.d"
}
}
],
"containerDefinitions": [
{
"name": "app-api",
"image": "node:latest", //不支援 "." ,可是 aws eb 的 single docker 是支援的
"essential": true,
"memory": 256, //全部加起來不能超過ec2機子的總量,卡這裡卡很久
"command": [
"/bin/bash",
"/usr/src/app/run-prod.sh"
],
"mountPoints": [
{
"sourceVolume": "app-api",
"containerPath": "/usr/src/app"
}
]
},
{
"name": "app-ui",
"image": "node:latest",
"essential": true,
"memory": 256,
"command": [
"/bin/bash",
"/usr/src/app/run-prod.sh"
],
"portMappings": [
{
"hostPort": 3000,
"containerPort": 3000
}
],
"mountPoints": [
{
"sourceVolume": "app-ui",
"containerPath": "/usr/src/app"
}
]
},
{
"name":"db",
"image":"mongo",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 27017,
"containerPort": 27017
}
]
},
{
"name": "nginx-proxy",
"image": "nginx",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"links": [
"app-api",
"app-ui",
"db"
],
"mountPoints": [
{
"sourceVolume": "awseb-logs-nginx-proxy",
"containerPath": "/var/log/nginx"
},
{
"sourceVolume": "nginx-proxy-conf",
"containerPath": "/etc/nginx/conf.d",
"readOnly": true
}
]
}
]
}
沒有留言:
張貼留言