Skip to content

Commit 77982c8

Browse files
author
Kshitij Saraogi
committed
[config]: Use PORT variable instead of HERCULES_PORT
1 parent dc14d1f commit 77982c8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.11
22

33
ENV PORT=8080
4-
ENV DATABASE_URL="user=kshitij10496 dbname=herculesdb sslmode=disable"
4+
ENV HERCULES_DATABASEURL="user=kshitij10496 dbname=herculesdb sslmode=disable"
55

66
RUN mkdir -p /go/src/github.com/kshitij10496/hercules
77
WORKDIR /go/src/github.com/kshitij10496/hercules

Gopkg.toml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
go-version = "1.11"
3030
install = ["."] # Explicit is better than implicit.
3131
ensure = true
32+
3233

3334
[[constraint]]
3435
name = "github.com/lib/pq"

common/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package common
33
// Config represents configuration environment to running application
44
type Config struct {
55
DatabaseURL string `required:"true" desc:"Connection String, for more info see: https://godoc.org/github.com/lib/pq"`
6-
Port string `default:"8080" desc:"Application listen port"`
6+
Port string `envconfig:"PORT" default:"8080" desc:"Application listen port"`
77
}

0 commit comments

Comments
 (0)