This commit is contained in:
Shaz hemani 2020-09-11 17:09:53 +05:00
parent b99e888781
commit 4c2414fa0a
No known key found for this signature in database
GPG key ID: 976B8B017678D5AC
3 changed files with 5 additions and 6 deletions

View file

@ -1,8 +1,8 @@
build: build:
docker-compose build docker-compose build
run: build run:
docker-compose up COMPOSE_PROJECT_NAME=genitywebapp docker-compose up --build
build-binary: build-binary:
GOOS=linux GOARCH=amd64 go build GOOS=linux GOARCH=amd64 go build

View file

@ -1,10 +1,10 @@
version: "3.8" version: "3"
services: services:
db: db:
image: postgres image: postgres
env_file: ./configs/db.env env_file: ./configs/db.env
volumes: volumes:
- ./db_postgres:/var/lib/postgresql/data - db_postgres:/var/lib/postgresql/data
- ./scripts/db/ddl_01.sql:/docker-entrypoint-initdb.d/10_schema.sql - ./scripts/db/ddl_01.sql:/docker-entrypoint-initdb.d/10_schema.sql
- ./scripts/db/dml_01.sql:/docker-entrypoint-initdb.d/20_insert.sql - ./scripts/db/dml_01.sql:/docker-entrypoint-initdb.d/20_insert.sql
expose: expose:

View file

@ -30,7 +30,6 @@ func main() {
} }
func initDb() { func initDb() {
config := dbConfig() config := dbConfig()
var err error var err error
@ -52,7 +51,7 @@ func initDb() {
func dbConfig() map[string]string { func dbConfig() map[string]string {
conf := make(map[string]string) conf := make(map[string]string)
conf[dbhost] = "POC-golang-postgres-docker_db_1" conf[dbhost] = "genitywebapp_db_1"
conf[dbport] = "5432" conf[dbport] = "5432"
conf[dbuser] = "root_user" conf[dbuser] = "root_user"
conf[dbpass] = "shahzad12" conf[dbpass] = "shahzad12"