Skip to content

Instantly share code, notes, and snippets.

@GalayM
Forked from axw/docker-compose.yml
Created May 23, 2022 11:44
Show Gist options
  • Select an option

  • Save GalayM/1ffc1e1ae96dcd3911518f6f3d2fbbd5 to your computer and use it in GitHub Desktop.

Select an option

Save GalayM/1ffc1e1ae96dcd3911518f6f3d2fbbd5 to your computer and use it in GitHub Desktop.

Revisions

  1. @axw axw revised this gist Nov 20, 2018. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -78,8 +78,7 @@ services:
    condition: service_healthy

    opbeans-go:
    build: .
    image: opbeans-go:latest
    image: opbeans/opbeans-go:latest
    ports:
    - "127.0.0.1:${OPBEANS_GO_PORT:-8000}:8000"
    logging:
  2. @axw axw created this gist Nov 19, 2018.
    145 changes: 145 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,145 @@
    version: "2.1"
    services:
    apm-server:
    image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-6.5.0}
    ports:
    - "127.0.0.1:${APM_SERVER_PORT:-8200}:8200"
    - "127.0.0.1:${APM_SERVER_MONITOR_PORT:-6060}:6060"
    command: >
    apm-server -e
    -E apm-server.rum.enabled=true
    -E apm-server.host=0.0.0.0:8200
    -E setup.kibana.host=kibana:5601
    cap_drop:
    - ALL
    cap_add:
    - CHOWN
    - DAC_OVERRIDE
    - SETGID
    - SETUID
    logging:
    driver: 'json-file'
    options:
    max-size: '2m'
    max-file: '5'
    depends_on:
    elasticsearch:
    condition: service_healthy
    healthcheck:
    test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://apm-server:8200/healthcheck"]
    retries: 10
    interval: 10s

    elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-6.5.0}
    environment:
    - cluster.name=docker-cluster
    - xpack.security.enabled=false
    - bootstrap.memory_lock=true
    - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    - "path.data=/usr/share/elasticsearch/data/${STACK_VERSION:-6.5.0}"
    ulimits:
    memlock:
    soft: -1
    hard: -1
    mem_limit: 5g
    logging:
    driver: 'json-file'
    options:
    max-size: '2m'
    max-file: '5'
    ports:
    - "127.0.0.1:${ELASTICSEARCH_PORT:-9200}:9200"
    healthcheck:
    test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"]
    retries: 10
    interval: 20s
    volumes:
    - esdata:/usr/share/elasticsearch/data

    kibana:
    image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-6.5.0}
    environment:
    SERVER_NAME: kibana.example.org
    ELASTICSEARCH_URL: http://elasticsearch:9200
    ports:
    - "127.0.0.1:${KIBANA_PORT:-5601}:5601"
    logging:
    driver: 'json-file'
    options:
    max-size: '2m'
    max-file: '5'
    healthcheck:
    test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://kibana:5601/"]
    retries: 10
    interval: 10s
    depends_on:
    elasticsearch:
    condition: service_healthy

    opbeans-go:
    build: .
    image: opbeans-go:latest
    ports:
    - "127.0.0.1:${OPBEANS_GO_PORT:-8000}:8000"
    logging:
    driver: 'json-file'
    options:
    max-size: '2m'
    max-file: '5'
    environment:
    - ELASTIC_APM_SERVER_URL=${ELASTIC_APM_SERVER_URL:-http://apm-server:8200}
    - ELASTIC_APM_JS_SERVER_URL=${ELASTIC_APM_JS_SERVER_URL:-http://localhost:8200}
    - PGHOST=postgres
    - PGUSER=postgres
    - PGPASSWORD=hunter2
    - PGDATABASE=opbeans
    - PGSSLMODE=disable
    - ELASTIC_APM_LOG_FILE=stderr
    - ELASTIC_APM_LOG_LEVEL=debug
    depends_on:
    redis:
    condition: service_healthy
    elasticsearch:
    condition: service_healthy
    apm-server:
    condition: service_healthy
    postgres:
    condition: service_started
    command:
    - "/opbeans-go"
    - "-listen=:${OPBEANS_GO_PORT:-8000}"
    - "-frontend=/opbeans-frontend"
    - "-db=postgres:"
    - "-cache=redis://redis:6379"

    redis:
    image: redis:4
    ports:
    - 6379:6379
    logging:
    driver: 'json-file'
    options:
    max-size: '2m'
    max-file: '5'
    healthcheck:
    test: ["CMD", "redis-cli", "ping"]
    interval: 10s

    postgres:
    image: postgres:latest
    environment:
    - POSTGRES_PASSWORD=hunter2
    - POSTGRES_DB=opbeans
    volumes:
    - pgdata:/var/lib/postgresql/data
    ports:
    - "127.0.0.1:5432:5432"

    volumes:
    esdata:
    driver: local
    opbeansdb:
    driver: local
    pgdata:
    driver: local