# docker-compose.yml for Skygear
#
# This docker-compose.yml requries Docker Compose 1.6. Do not modify this
# file for local development--create `docker-compose.override.yml` to override
# settings here.

version: '2'

services:
  db:
    image: mdillon/postgis:9.5
    volumes:
    - db_data:/var/lib/postgresql/data
    ports:
    - "5432:5432"

  redis:
    image: redis:3.0
    volumes:
    - redis_data:/data

  app:
    image: skygeario/skygear-server:latest
    ports:
    - "3000:3000" # Skygear Server API Endpoint (HTTP)
    - "5555:5555" # Skygear Server Plugin Endpoint (ZMQ)
    volumes:
    - app_data:/go/src/app/data
    links:
    - db
    - redis
    command: skygear-server
    environment:
      # `db` in the following string should match the name of the database
      # container above.
      DATABASE_URL: postgresql://postgres:@db/postgres?sslmode=disable
      REDISTEST: redis://redis:6379
      API_KEY: changeme
      MASTER_KEY: secret
      APP_NAME: _
      # GOMAXPROCS - The maximum number of Go threads for execution.
      # When unspecified, the default is the number of CPU available, which
      # is the recommended setting.
      #GOMAXPROCS: 1

volumes:
  redis_data:
    driver: local
  db_data:
    driver: local
  app_data:
    driver: local

# docker-compose.yml for Skygear
#
# This docker-compose.yml requries Docker Compose 1.6. Do not modify this
# file for local development--create `docker-compose.override.yml` to override
# settings here.

version: '2'

services:
  db:
    image: mdillon/postgis:9.5
    volumes:
    - db_data:/var/lib/postgresql/data
    ports:
    - "65432:5432"

  app:
    image: skygeario/skygear-server:latest
    ports:
    - "3000:3000" # Skygear Server API Endpoint (HTTP)
    - "5555:5555" # Skygear Server Plugin Endpoint (ZMQ)
    volumes:
    - app_data:/go/src/app/data
    links:
    - db
    command: skygear-server
    restart: always
    environment:
      # `db` in the following string should match the name of the database
      # container above.
      DATABASE_URL: postgresql://postgres:@db/postgres?sslmode=disable
      REDISTEST: redis://redis:6379
      API_KEY: changeme
      MASTER_KEY: secret
      APP_NAME: _
      TOKEN_STORE: jwt
      TOKEN_STORE_SECRET: my_skygear_jwt_secret
      # GOMAXPROCS - The maximum number of Go threads for execution.
      # When unspecified, the default is the number of CPU available, which
      # is the recommended setting.
      #GOMAXPROCS: 1

volumes:
  db_data:
    driver: local
  app_data:
    driver: local

Mark the skygear-server restart to always and remove redis
Mark the skygear-server restart to always and remove redis

It will solve the first time init fails. The skygear-server will restart until
it works and user will see it up and running after the DB is finished init.

connect #145
