1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-06 23:46:29 +02:00

128 lines
3.0 KiB
YAML
Raw Permalink Normal View History

# https://docs.docker.com/compose/compose-file
# docker-compose up
# docker-compose stop
# docker-compose down
version: '3'
networks:
main:
services:
2019-05-23 14:01:24 -05:00
postgres:
image: postgres:11-alpine
expose:
- "5433"
ports:
- "5433:5432"
networks:
main:
aliases:
- postgres
2019-05-23 14:01:24 -05:00
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- POSTGRES_DB=shared
2019-05-23 14:01:24 -05:00
redis:
image: redis:latest
expose:
- "6379"
ports:
2019-05-23 14:01:24 -05:00
- "6379:6379"
networks:
main:
aliases:
- redis
2019-05-23 14:01:24 -05:00
entrypoint: redis-server --appendonly yes
2019-05-23 14:01:24 -05:00
datadog:
image: example-project/datadog:latest
2019-05-23 14:01:24 -05:00
build:
context: docker/datadog-agent
dockerfile: Dockerfile
ports:
- 8125:8125 # metrics
- 8126:8126 # tracing
networks:
main:
aliases:
- datadog
2019-05-23 14:01:24 -05:00
env_file:
- .env_docker_compose
environment:
- DD_LOGS_ENABLED=true
- DD_APM_ENABLED=true
- DD_RECEIVER_PORT=8126
- DD_APM_NON_LOCAL_TRAFFIC=true
- DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
- DD_TAGS=source:docker env:dev
- DD_DOGSTATSD_ORIGIN_DETECTION=true
- DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true
#- ECS_FARGATE=false
- DD_EXPVAR=service_name=web-app env=dev url=http://web-app:4000/debug/vars|service_name=web-api env=dev url=http://web-api:4001/debug/vars
2019-05-23 14:01:24 -05:00
web-app:
image: example-project/web-app:latest
2019-05-23 14:01:24 -05:00
build:
context: .
dockerfile: cmd/web-app/Dockerfile
ports:
- 3000:3000 # WEB APP
- 4000:4000 # DEBUG API
networks:
main:
aliases:
- web-app
2019-05-23 14:01:24 -05:00
links:
- postgres
- redis
- datadog
env_file:
- .env_docker_compose
environment:
2019-05-23 14:01:24 -05:00
- WEB_APP_HTTP_HOST=0.0.0.0:3000
- WEB_APP_APP_BASE_URL=http://127.0.0.1:3000
- WEB_API_APP_DEBUG_HOST=0.0.0.0:4000
- WEB_APP_REDIS_HOST=redis:6379
- WEB_APP_DB_HOST=postgres:5433
2019-05-23 14:01:24 -05:00
- WEB_APP_DB_USER=postgres
- WEB_APP_DB_PASS=postgres
- WEB_APP_DB_DATABASE=shared
- DD_TRACE_AGENT_HOSTNAME=datadog
- DD_TRACE_AGENT_PORT=8126
- DD_SERVICE_NAME=web-app
- DD_ENV=dev
# - GODEBUG=gctrace=1
2019-05-23 14:01:24 -05:00
web-api:
image: example-project/web-api:latest
2019-05-23 14:01:24 -05:00
build:
context: .
dockerfile: cmd/web-api/Dockerfile
ports:
2019-05-23 14:01:24 -05:00
- 3001:3001 # WEB API
- 4001:4001 # DEBUG API
networks:
main:
aliases:
- web-api
2019-05-23 14:01:24 -05:00
links:
- postgres
- redis
- datadog
env_file:
- .env_docker_compose
environment:
- WEB_API_HTTP_HOST=0.0.0.0:3001
- WEB_API_APP_BASE_URL=http://127.0.0.1:3001
- WEB_API_APP_DEBUG_HOST=0.0.0.0:4001
- WEB_API_REDIS_HOST=redis:6379
- WEB_API_DB_HOST=postgres:5433
2019-05-23 14:01:24 -05:00
- WEB_API_DB_USER=postgres
- WEB_API_DB_PASS=postgres
- WEB_API_DB_DATABASE=shared
- DD_TRACE_AGENT_HOSTNAME=datadog
- DD_TRACE_AGENT_PORT=8126
- DD_SERVICE_NAME=web-app
- DD_ENV=dev
# - GODEBUG=gctrace=1