Add database setup commands

This commit is contained in:
Vikram Rangnekar
2019-09-28 11:34:03 -04:00
parent 527ea5044d
commit 7e4d14fbca
12 changed files with 220 additions and 90 deletions

View File

@ -1,6 +1,6 @@
-- Write your migrate up statements here
CREATE DATABASE {{ .app_name_slug }}_database
CREATE DATABASE {{ .app_name_slug }}_{{ .env }}
-- CREATE TABLE public.users (
-- id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
@ -18,4 +18,4 @@ CREATE DATABASE {{ .app_name_slug }}_database
-- DROP TABLE public.users
DROP DATABASE IF EXISTS {{ .app_name_slug }}_database
DROP DATABASE IF EXISTS {{ .app_name_slug }}_{{ .env }}

4
tmpl/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM dosco/super-graph:latest
WORKDIR /
COPY config/* /config/

View File

@ -1,4 +1,4 @@
app_name: "{{ .app_name }} Development"
app_name: "{% app_name %} Development"
host_port: 0.0.0.0:8080
web_ui: true
@ -84,7 +84,7 @@ database:
type: postgres
host: db
port: 5432
dbname: {{ .app_name_slug }}_database
dbname: {% app_name_slug %}_development
user: postgres
password: ''

View File

@ -5,7 +5,7 @@ services:
ports:
- "5432:5432"
{{ .app_name_slug }}_api:
{% app_name_slug %}_api:
image: dosco/super-graph:latest
environment:
GO_ENV: "development"

View File

@ -1,4 +1,4 @@
app_name: "{{ .app_name }} Production"
app_name: "{% app_name %} Production"
host_port: 0.0.0.0:8080
web_ui: false
@ -80,7 +80,7 @@ database:
type: postgres
host: db
port: 5432
dbname: {{ .app_name_slug }}_database
dbname: {% app_name_slug %}_production
user: postgres
password: ''
#pool_size: 10