Permalink
Browse files

fix #147: use custom database

  • Loading branch information...
kamilsk committed Jan 7, 2019
1 parent ced0623 commit e11810a9733aa709807893710b4339c80f39f996
@@ -23,7 +23,7 @@ var (
"read_header_timeout": time.Duration(0),
"write_timeout": time.Duration(0),
"idle_timeout": time.Duration(0),
"dsn": "postgres://postgres:postgres@127.0.0.1:5432/postgres?connect_timeout=1&sslmode=disable",
"dsn": "postgres://click:click@127.0.0.1:5432/click?connect_timeout=1&sslmode=disable",
"open_conn": 1,
"idle_conn": 1,
"conn_max_lt": 0,
@@ -41,7 +41,7 @@ IDLE_TIMEOUT=0

CLICK_TOKEN=10000000-2000-4000-8000-160000000003

DB_DSN=postgres://postgres:postgres@db:5432/postgres?connect_timeout=1&sslmode=disable
DB_DSN=postgres://click:click@db:5432/click?connect_timeout=1&sslmode=disable
DB_OPEN_CONN=1
DB_IDLE_CONN=1
DB_CONN_MAX_LT=0
@@ -5,6 +5,8 @@ services:
db:
image: postgres:10-alpine # https://hub.docker.com/_/postgres/
env_file: ../../.env
volumes:
- ../db/initdb.d:/docker-entrypoint-initdb.d

migration:
image: kamilsk/click:3.x # https://hub.docker.com/r/kamilsk/click/
@@ -1,11 +1,3 @@
version: "3"

services:

db: {}

migration: {}

service: {}

server: {}
services: {}
@@ -1,11 +1,3 @@
version: "3"

services:

db: {}

migration: {}

service: {}

server: {}
services: {}
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER "click" WITH PASSWORD 'click';
CREATE DATABASE "click" WITH OWNER "click";
\c "click";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
EOSQL

0 comments on commit e11810a

Please sign in to comment.