Skip to content

Commit def099f

Browse files
committed
update database host configuration and add Dockerfile for containerization
1 parent 878ab3a commit def099f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.18
2+
3+
WORKDIR /go/src/app
4+
5+
COPY . .
6+
7+
EXPOSE 8000
8+
9+
RUN go build -o main cmd/main.go
10+
11+
CMD ["./main"]

db/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const (
11-
host = "localhost"
11+
host = "go_db"
1212
port = 5432
1313
user = "postgres"
1414
password = "1234"

0 commit comments

Comments
 (0)