Commit d6509052 authored by Lee Brown's avatar Lee Brown

update docker-compose

parent 29da8a1b
{
"family": "{SERVICE}",
"executionRoleArn": "",
"taskRoleArn": "",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name": "{ECS_SERVICE}",
"image": "{RELEASE_IMAGE}",
"essential": true,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "{AWS_LOGS_GROUP}",
"awslogs-region": "{AWS_DEFAULT_REGION}",
"awslogs-stream-prefix": "ecs"
}
},
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"cpu": 128,
"memoryReservation": 128,
"volumesFrom": [],
"environment": [
{"name": "AWS_DEFAULT_REGION", "value": "{AWS_DEFAULT_REGION}"},
{"name": "AWS_USE_ROLE", "value": "true"},
{"name": "AWSLOGS_GROUP", "value": "{AWS_LOGS_GROUP}"},
{"name": "ECS_CLUSTER", "value": "{ECS_CLUSTER}"},
{"name": "ECS_SERVICE", "value": "{ECS_SERVICE}"},
{"name": "WEB_API_HTTP_HOST", "value": "{HTTP_HOST}"},
{"name": "WEB_API_HTTPS_HOST", "value": "{HTTPS_HOST}"},
{"name": "WEB_API_SERVICE_SERVICE_NAME", "value": "{SERVICE}"},
{"name": "WEB_API_SERVICE_BASE_URL", "value": "{APP_BASE_URL}"},
{"name": "WEB_API_SERVICE_HOST_NAMES", "value": "{HOST_NAMES}"},
{"name": "WEB_API_SERVICE_ENABLE_HTTPS", "value": "{HTTPS_ENABLED}"},
{"name": "WEB_API_PROJECT_PROJECT_NAME", "value": "{APP_PROJECT}"},
{"name": "WEB_API_PROJECT_EMAIL_SENDER", "value": "{EMAIL_SENDER}"},
{"name": "WEB_API_PROJECT_WEB_APP_BASE_URL", "value": "{WEB_APP_BASE_URL}"},
{"name": "WEB_API_REDIS_HOST", "value": "{CACHE_HOST}"},
{"name": "WEB_API_DB_HOST", "value": "{DB_HOST}"},
{"name": "WEB_API_DB_USER", "value": "{DB_USER}"},
{"name": "WEB_API_DB_PASS", "value": "{DB_PASS}"},
{"name": "WEB_API_DB_DATABASE", "value": "{DB_DATABASE}"},
{"name": "WEB_API_DB_DRIVER", "value": "{DB_DRIVER}"},
{"name": "WEB_API_DB_DISABLE_TLS", "value": "{DB_DISABLE_TLS}"},
{"name": "WEB_API_AUTH_USE_AWS_SECRET_MANAGER", "value": "true"},
{"name": "WEB_API_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
{"name": "WEB_API_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
{"name": "WEB_API_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
{"name": "CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
{"name": "CI_COMMIT_SHORT_SHA", "value": "{CI_COMMIT_SHORT_SHA}"},
{"name": "CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
{"name": "CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
{"name": "CI_JOB_ID", "value": "{CI_JOB_ID}"},
{"name": "CI_JOB_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/-/jobs/{CI_JOB_ID}"},
{"name": "CI_PIPELINE_ID", "value": "{CI_PIPELINE_ID}"},
{"name": "CI_PIPELINE_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/pipelines/{CI_PIPELINE_ID}"},
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
{"name": "DD_SERVICE_NAME", "value": "{ECS_SERVICE}"},
{"name": "DD_ENV", "value": "{ENV}"},
{"name": "ROUTE53_UPDATE_TASK_IPS", "value": "{ROUTE53_UPDATE_TASK_IPS}"},
{"name": "ROUTE53_ZONES", "value": "{ROUTE53_ZONES}"},
{"name": "ECS_ENABLE_CONTAINER_METADATA", "value": "true"}
],
"healthCheck": {
"retries": 3,
"command": [
"CMD-SHELL",
"curl -f http://localhost/ping || exit 1"
],
"timeout": 5,
"interval": 60,
"startPeriod": 60
},
"dockerLabels": {
"com.datadoghq.ad.check_names": "[\"{ECS_SERVICE}\"]",
"com.datadoghq.ad.logs": "[{\"source\": \"docker\", \"service\": \"{ECS_SERVICE}\", \"service_name\": \"{SERVICE}\", \"cluster\": \"{ECS_CLUSTER}\", \"env\": \"{ENV}\"}]",
"com.datadoghq.ad.init_configs": "[{}]",
"com.datadoghq.ad.instances": "[{\"host\": \"%%host%%\", \"port\": 80}]"
},
"ulimits": [
{
"name": "nofile",
"softLimit": 987654,
"hardLimit": 999999
}
]
},
{
"name": "datadog-agent",
"image": "datadog/agent:latest",
"essential": {DATADOG_ESSENTIAL},
"cpu": 128,
"memoryReservation": 128,
"portMappings": [
{
"containerPort": 8125
},
{
"containerPort": 8126
}
],
"environment": [
{
"name": "DD_API_KEY",
"value": "{DATADOG_APIKEY}"
},
{
"name": "DD_LOGS_ENABLED",
"value": "true"
},
{
"name": "DD_APM_ENABLED",
"value": "true"
},
{
"name": "DD_RECEIVER_PORT",
"value": "8126"
},
{
"name": "DD_APM_NON_LOCAL_TRAFFIC",
"value": "true"
},
{
"name": "DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL",
"value": "true"
},
{
"name": "DD_TAGS",
"value": "source:docker service:{ECS_SERVICE} service_name:{SERVICE} cluster:{ECS_CLUSTER} env:{ENV}"
},
{
"name": "DD_DOGSTATSD_ORIGIN_DETECTION",
"value": "true"
},
{
"name": "DD_DOGSTATSD_NON_LOCAL_TRAFFIC",
"value": "true"
},
{
"name": "ECS_FARGATE",
"value": "true"
}
]
}
],
"volumes": [],
"requiresCompatibilities": [
"FARGATE"
]
}
......@@ -2,5 +2,4 @@ export WEB_API_DB_HOST=127.0.0.1:5433
export WEB_API_DB_USER=postgres
export WEB_API_DB_PASS=postgres
export WEB_API_DB_DISABLE_TLS=true
export WEB_API_REDIS_HOST=:6378
export WEB_API_SERVICE_EMAIL_SENDER=valdez@example.com
{
"family": "{SERVICE}",
"executionRoleArn": "",
"taskRoleArn": "",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name": "{ECS_SERVICE}",
"image": "{RELEASE_IMAGE}",
"essential": true,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "{AWS_LOGS_GROUP}",
"awslogs-region": "{AWS_DEFAULT_REGION}",
"awslogs-stream-prefix": "ecs"
}
},
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"cpu": 128,
"memoryReservation": 128,
"volumesFrom": [],
"environment": [
{"name": "AWS_DEFAULT_REGION", "value": "{AWS_DEFAULT_REGION}"},
{"name": "AWS_USE_ROLE", "value": "true"},
{"name": "AWSLOGS_GROUP", "value": "{AWS_LOGS_GROUP}"},
{"name": "ECS_CLUSTER", "value": "{ECS_CLUSTER}"},
{"name": "ECS_SERVICE", "value": "{ECS_SERVICE}"},
{"name": "WEB_APP_HTTP_HOST", "value": "{HTTP_HOST}"},
{"name": "WEB_APP_HTTPS_HOST", "value": "{HTTPS_HOST}"},
{"name": "WEB_APP_SERVICE_SERVICE_NAME", "value": "{SERVICE}"},
{"name": "WEB_APP_SERVICE_BASE_URL", "value": "{APP_BASE_URL}"},
{"name": "WEB_APP_SERVICE_HOST_NAMES", "value": "{HOST_NAMES}"},
{"name": "WEB_APP_SERVICE_ENABLE_HTTPS", "value": "{HTTPS_ENABLED}"},
{"name": "WEB_APP_SERVICE_STATICFILES_S3_ENABLED", "value": "{STATIC_FILES_S3_ENABLED}"},
{"name": "WEB_APP_SERVICE_STATICFILES_S3_PREFIX", "value": "{STATIC_FILES_S3_PREFIX}"},
{"name": "WEB_APP_SERVICE_STATICFILES_CLOUDFRONT_ENABLED", "value": "{STATIC_FILES_CLOUDFRONT_ENABLED}"},
{"name": "WEB_APP_SERVICE_STATICFILES_IMG_RESIZE_ENABLED", "value": "{STATIC_FILES_IMG_RESIZE_ENABLED}"},
{"name": "WEB_APP_PROJECT_PROJECT_NAME", "value": "{APP_PROJECT}"},
{"name": "WEB_APP_PROJECT_EMAIL_SENDER", "value": "{EMAIL_SENDER}"},
{"name": "WEB_APP_PROJECT_WEB_API_BASE_URL", "value": "{WEB_API_BASE_URL}"},
{"name": "WEB_APP_REDIS_HOST", "value": "{CACHE_HOST}"},
{"name": "WEB_APP_DB_HOST", "value": "{DB_HOST}"},
{"name": "WEB_APP_DB_USER", "value": "{DB_USER}"},
{"name": "WEB_APP_DB_PASS", "value": "{DB_PASS}"},
{"name": "WEB_APP_DB_DATABASE", "value": "{DB_DATABASE}"},
{"name": "WEB_APP_DB_DRIVER", "value": "{DB_DRIVER}"},
{"name": "WEB_APP_DB_DISABLE_TLS", "value": "{DB_DISABLE_TLS}"},
{"name": "WEB_APP_AUTH_USE_AWS_SECRET_MANAGER", "value": "true"},
{"name": "WEB_APP_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
{"name": "WEB_APP_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
{"name": "WEB_APP_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
{"name": "CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
{"name": "CI_COMMIT_SHORT_SHA", "value": "{CI_COMMIT_SHORT_SHA}"},
{"name": "CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
{"name": "CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
{"name": "CI_JOB_ID", "value": "{CI_JOB_ID}"},
{"name": "CI_JOB_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/-/jobs/{CI_JOB_ID}"},
{"name": "CI_PIPELINE_ID", "value": "{CI_PIPELINE_ID}"},
{"name": "CI_PIPELINE_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/pipelines/{CI_PIPELINE_ID}"},
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
{"name": "DD_SERVICE_NAME", "value": "{ECS_SERVICE}"},
{"name": "DD_ENV", "value": "{ENV}"},
{"name": "ROUTE53_UPDATE_TASK_IPS", "value": "{ROUTE53_UPDATE_TASK_IPS}"},
{"name": "ROUTE53_ZONES", "value": "{ROUTE53_ZONES}"},
{"name": "ECS_ENABLE_CONTAINER_METADATA", "value": "true"}
],
"healthCheck": {
"retries": 3,
"command": [
"CMD-SHELL",
"curl -f http://localhost/ping || exit 1"
],
"timeout": 5,
"interval": 60,
"startPeriod": 60
},
"dockerLabels": {
"com.datadoghq.ad.check_names": "[\"{ECS_SERVICE}\"]",
"com.datadoghq.ad.logs": "[{\"source\": \"docker\", \"service\": \"{ECS_SERVICE}\", \"service_name\": \"{SERVICE}\", \"cluster\": \"{ECS_CLUSTER}\", \"env\": \"{ENV}\"}]",
"com.datadoghq.ad.init_configs": "[{}]",
"com.datadoghq.ad.instances": "[{\"host\": \"%%host%%\", \"port\": 80}]"
},
"ulimits": [
{
"name": "nofile",
"softLimit": 987654,
"hardLimit": 999999
}
]
},
{
"name": "datadog-agent",
"image": "datadog/agent:latest",
"essential": {DATADOG_ESSENTIAL},
"cpu": 128,
"memoryReservation": 128,
"portMappings": [
{
"containerPort": 8125
},
{
"containerPort": 8126
}
],
"environment": [
{
"name": "DD_API_KEY",
"value": "{DATADOG_APIKEY}"
},
{
"name": "DD_LOGS_ENABLED",
"value": "true"
},
{
"name": "DD_APM_ENABLED",
"value": "true"
},
{
"name": "DD_RECEIVER_PORT",
"value": "8126"
},
{
"name": "DD_APM_NON_LOCAL_TRAFFIC",
"value": "true"
},
{
"name": "DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL",
"value": "true"
},
{
"name": "DD_TAGS",
"value": "source:docker service:{ECS_SERVICE} service_name:{SERVICE} cluster:{ECS_CLUSTER} env:{ENV}"
},
{
"name": "DD_DOGSTATSD_ORIGIN_DETECTION",
"value": "true"
},
{
"name": "DD_DOGSTATSD_NON_LOCAL_TRAFFIC",
"value": "true"
},
{
"name": "ECS_FARGATE",
"value": "true"
}
]
}
],
"volumes": [],
"requiresCompatibilities": [
"FARGATE"
]
}
......@@ -2,5 +2,4 @@ export WEB_APP_DB_HOST=127.0.0.1:5433
export WEB_APP_DB_USER=postgres
export WEB_APP_DB_PASS=postgres
export WEB_APP_DB_DISABLE_TLS=true
export WEB_APP_REDIS_HOST=:6378
export WEB_APP_SERVICE_EMAIL_SENDER=valdez@example.com
\ No newline at end of file
......@@ -26,9 +26,9 @@ services:
redis:
image: redis:latest
expose:
- "6378"
- "6379"
ports:
- "6378:6379"
- "6379:6379"
networks:
main:
aliases:
......@@ -80,6 +80,7 @@ services:
- postgres
- redis
- datadog
- web-api
env_file:
- configs/.env_docker_compose
environment:
......
......@@ -41,7 +41,7 @@ require (
github.com/tinylib/msgp v1.1.0 // indirect
github.com/urfave/cli v1.21.0
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
gitlab.com/geeks-accelerator/oss/devops v1.0.25
gitlab.com/geeks-accelerator/oss/devops v1.0.32
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de // indirect
......@@ -53,3 +53,5 @@ require (
)
// replace gitlab.com/geeks-accelerator/oss/devops => ../devops
go 1.13
......@@ -215,16 +215,8 @@ github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVU
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryBNl9eKOeqQ58Y/Qpo3Q9QNxKHX5uzzQ=
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
gitlab.com/geeks-accelerator/oss/devops v1.0.19 h1:x/PknYjZFZNfrm9TW4wWXlI73Jd56HYrQt3a1IUbpK8=
gitlab.com/geeks-accelerator/oss/devops v1.0.19/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
gitlab.com/geeks-accelerator/oss/devops v1.0.22 h1:QKTId3GXzSlcXzWYYzLSq/3kniQKRrdygnTYL5MnCe0=
gitlab.com/geeks-accelerator/oss/devops v1.0.22/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
gitlab.com/geeks-accelerator/oss/devops v1.0.23 h1:ZYWIye57YWJPIV02TKJABbWZ4UXJWQb2PynzsJWbLak=
gitlab.com/geeks-accelerator/oss/devops v1.0.23/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
gitlab.com/geeks-accelerator/oss/devops v1.0.24 h1:dwKagA+p9AE9wfmfCrwDBwnK/1rMxUJ4wxhabd3+M7A=
gitlab.com/geeks-accelerator/oss/devops v1.0.24/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
gitlab.com/geeks-accelerator/oss/devops v1.0.25 h1:ilGlqaQ71Ps8yyDHv0uPLifOkoe2juobJlflGjWrWEM=
gitlab.com/geeks-accelerator/oss/devops v1.0.25/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
gitlab.com/geeks-accelerator/oss/devops v1.0.32 h1:0fN8MBRbmPmQQXaM3KTSsRagocpoJpz2gMBeunj38HU=
gitlab.com/geeks-accelerator/oss/devops v1.0.32/go.mod h1:xr+rhNSDXrEh0A6bkBPnfMiRIou3OiPZK0oD5h9GAAM=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
......
......@@ -79,6 +79,7 @@ func (a *App) Handle(verb, path string, handler Handler, mw ...Middleware) {
// If we have specifically handled the error, then no need
// to initiate a shutdown.
// This shouldn't happen because the error middleware should handle this....
if webErr, ok := err.(*weberror.Error); ok {
// Render an error response.
if rerr := RespondErrorStatus(ctx, w, webErr.Err, webErr.Status); rerr == nil {
......@@ -91,6 +92,7 @@ func (a *App) Handle(verb, path string, handler Handler, mw ...Middleware) {
if ok := a.SignalShutdown(); !ok {
// When shutdown chan is nil, in the case of unit testing
// we need to force display of the error.
// TODO: the http package captures the panic and wont't force a shutdown, replace this
panic(err)
}
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment