Skip to content

Instantly share code, notes, and snippets.

@jl91
Forked from mikkelkrogsholm/docker-compose.yml
Created January 8, 2019 15:42
Show Gist options
  • Select an option

  • Save jl91/48b5efc8b48c8922a5798cd7423d72e3 to your computer and use it in GitHub Desktop.

Select an option

Save jl91/48b5efc8b48c8922a5798cd7423d72e3 to your computer and use it in GitHub Desktop.

Revisions

  1. @mikkelkrogsholm mikkelkrogsholm revised this gist Dec 29, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -109,6 +109,8 @@ services:
    container_name: elastic
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    restart: always
    networks:
    - kong-net
    environment:
    - "discovery.type=single-node"

    @@ -119,6 +121,8 @@ services:
    image: rocker/tidyverse:3.5.0
    container_name: rstudio
    restart: always
    networks:
    - kong-net
    ports:
    - "8787:8787"
    volumes:
  2. @mikkelkrogsholm mikkelkrogsholm revised this gist Dec 29, 2018. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -109,8 +109,6 @@ services:
    container_name: elastic
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    restart: always
    volumes:
    - es-data:/usr/share/elasticsearch/data
    environment:
    - "discovery.type=single-node"

  3. @mikkelkrogsholm mikkelkrogsholm revised this gist Dec 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ services:
    environment:
    POSTGRES_USER: kong
    POSTGRES_DB: kong
    ports:
    # ports:
    # - "5432:5432"
    expose:
    - 5432
  4. @mikkelkrogsholm mikkelkrogsholm created this gist Dec 29, 2018.
    130 changes: 130 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,130 @@
    version: "3"

    networks:
    kong-net:
    driver: bridge

    services:

    #######################################
    # Postgres: The database used by Kong
    #######################################
    kong-database:
    image: postgres:11
    restart: always
    networks:
    - kong-net
    environment:
    POSTGRES_USER: kong
    POSTGRES_DB: kong
    ports:
    # - "5432:5432"
    expose:
    - 5432
    healthcheck:
    test: ["CMD", "pg_isready", "-U", "kong"]
    interval: 5s
    timeout: 5s
    retries: 5

    #######################################
    # Kong database migration
    #######################################
    kong-migration:
    image: kong:0.14
    command: "kong migrations up"
    networks:
    - kong-net
    restart: on-failure
    environment:
    KONG_PG_HOST: kong-database
    links:
    - kong-database
    depends_on:
    - kong-database

    #######################################
    # Kong: The API Gateway
    #######################################
    kong:
    image: kong:0.14
    restart: always
    networks:
    - kong-net
    environment:
    KONG_PG_HOST: kong-database
    KONG_PROXY_LISTEN: 0.0.0.0:8000
    KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
    KONG_ADMIN_LISTEN: 0.0.0.0:8001
    depends_on:
    - kong-migration
    - kong-database
    healthcheck:
    test: ["CMD", "curl", "-f", "http://kong:8001"]
    interval: 5s
    timeout: 2s
    retries: 15
    ports:
    # - "8001:8001"
    - "8000:8000"

    #######################################
    # Konga database prepare
    #######################################
    konga-prepare:
    image: pantsel/konga:0.13.0
    command: "-c prepare -a postgres -u postgresql://kong@kong-database:5432/konga_db"
    networks:
    - kong-net
    restart: on-failure
    links:
    - kong-database
    depends_on:
    - kong-database

    #######################################
    # Konga: Kong GUI
    #######################################
    konga:
    image: pantsel/konga:0.13.0
    restart: always
    networks:
    - kong-net
    environment:
    DB_ADAPTER: postgres
    DB_HOST: kong-database
    DB_USER: kong
    TOKEN_SECRET: km1GUr4RkcQD7DewhJPNXrCuZwcKmqjb
    DB_DATABASE: konga_db
    NODE_ENV: production
    depends_on:
    - kong-database
    ports:
    - "1337:1337"

    #######################################
    # Elastic: Set up an elastic docker behind Kong
    #######################################
    elastic:
    container_name: elastic
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    restart: always
    volumes:
    - es-data:/usr/share/elasticsearch/data
    environment:
    - "discovery.type=single-node"

    #######################################
    # Rstudio for having a nice IDE
    #######################################
    rstudio:
    image: rocker/tidyverse:3.5.0
    container_name: rstudio
    restart: always
    ports:
    - "8787:8787"
    volumes:
    - ./rstudio:/home/mikkel
    environment:
    - USER=user1
    - PASSWORD=user1