From bbce52a92a09645fd80af6967917d7f4b5c9406e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Mon, 19 Feb 2018 15:39:47 +0100
Subject: [PATCH] Update to server changes.

---
 README.md          |  5 +++--
 docker-compose.yml | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 9e780c7..01988fd 100644
--- a/README.md
+++ b/README.md
@@ -14,11 +14,12 @@ Clone this repository and then you can:
 - Stop and/or remove all data: `make destroy`
 
 It runs:
+ - PostgreSQL on port `5432`
  - Elasticsearch on port `9200`
  - Open Lobby Server on port `8010` - GraphQL API endpoint and GraphiQL
    interface are at `http://localhost:8010/graphql`
  - Open Lobby App on port `8020` - web application is at `http://localhost:8020`
 
 You may notice some errors and crashes if you access it immediately because
-Elasticsearch starts slowly. But it should recover and eventually it will be all
-running fine.
+PostgreSQL and Elasticsearch starts slowly. But it should recover and eventually
+it will be all running fine.
diff --git a/docker-compose.yml b/docker-compose.yml
index ee1ec33..f2ad4f9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,6 +1,18 @@
 version: "2"
 
 services:
+    openlobby-postgres:
+        image: postgres:9.5
+        environment:
+            - POSTGRES_USER=db
+            - POSTGRES_PASSWORD=db
+            - POSTGRES_DB=openlobby
+        ports:
+            - "5432:5432"
+        restart: always
+        volumes:
+            - postgres-data:/var/lib/postgresql/data
+
     openlobby-es:
         image: openlobby/openlobby-es-czech:latest
         environment:
@@ -25,8 +37,10 @@ services:
             - "8010:8010"
         restart: always
         depends_on:
+            - openlobby-postgres
             - openlobby-es
         environment:
+            - DATABASE_DSN=postgresql://db:db@openlobby-postgres:5432/openlobby
             - ELASTICSEARCH_DSN=http://openlobby-es:9200
             - SECRET_KEY=unsecure-demo-secret-key
 
@@ -42,5 +56,7 @@ services:
             - SECRET_KEY=another-demo-secret-key
 
 volumes:
+    postgres-data:
+        driver: local
     es-data:
         driver: local
-- 
GitLab