Skip to content

Commit

Permalink
Update MySQL TimeZone
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmmdriz committed Jun 25, 2024
1 parent 2e0ea2f commit 54db32e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ WORKDIR /app

COPY . .

RUN apk add --no-cache tzdata

RUN go mod download

RUN go build -o /goapp
Expand All @@ -12,6 +14,7 @@ FROM alpine:3.19 AS build-release-stage

WORKDIR /

COPY --from=build-stage /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build-stage /goapp /goapp
COPY --from=build-stage /app/templates ./templates

Expand Down
2 changes: 1 addition & 1 deletion drivers/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Config struct {
}

func ConnectDB(config Config) *gorm.DB {
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Asia%%2FJakarta",
config.DB_USERNAME,
config.DB_PASSWORD,
config.DB_HOST,
Expand Down

0 comments on commit 54db32e

Please sign in to comment.