Skip to content

Commit 55b5d46

Browse files
feat: added copy of .env to dockerfile
1 parent 24d05d7 commit 55b5d46

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ WORKDIR /app
1515

1616
# Copy CA certificates
1717
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
18+
# Copy the .env file into the container
19+
COPY .env .
1820
COPY --from=builder /app/api .
1921

2022
EXPOSE 8080

cmd/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (app *application) run(mux http.Handler) error {
201201
}
202202

203203
srv := &http.Server{
204-
Addr: ":" + port,
204+
Addr: app.config.addr,
205205
Handler: mux,
206206
WriteTimeout: time.Second * 30,
207207
ReadTimeout: time.Second * 10,

cmd/api/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func main() {
114114
}
115115

116116
cfg := config{
117-
addr: os.Getenv("PORT"),
117+
addr: os.Getenv("ADDR"),
118118
env: os.Getenv("ENV"),
119119
frontendURL: os.Getenv("FRONTEND_URL"),
120120
apiURL: os.Getenv("EXTERNAL_URL"),

0 commit comments

Comments
 (0)