topic/cleaning #4
4
Makefile
4
Makefile
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
3
main.go
3
main.go
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue