parent
b99e888781
commit
4c2414fa0a
4
Makefile
4
Makefile
|
@ -1,8 +1,8 @@
|
|||
build:
|
||||
docker-compose build
|
||||
|
||||
run: build
|
||||
docker-compose up
|
||||
run:
|
||||
COMPOSE_PROJECT_NAME=genitywebapp docker-compose up --build
|
||||
|
||||
build-binary:
|
||||
GOOS=linux GOARCH=amd64 go build
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
version: "3.8"
|
||||
version: "3"
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
env_file: ./configs/db.env
|
||||
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/dml_01.sql:/docker-entrypoint-initdb.d/20_insert.sql
|
||||
expose:
|
||||
|
|
3
main.go
3
main.go
|
@ -30,7 +30,6 @@ func main() {
|
|||
|
||||
}
|
||||
|
||||
|
||||
func initDb() {
|
||||
config := dbConfig()
|
||||
var err error
|
||||
|
@ -52,7 +51,7 @@ func initDb() {
|
|||
|
||||
func dbConfig() 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[dbuser] = "root_user"
|
||||
conf[dbpass] = "shahzad12"
|
||||
|
|
Loading…
Reference in a new issue