Skip to content

Commit

Permalink
fix port
Browse files Browse the repository at this point in the history
  • Loading branch information
fifsky committed Mar 21, 2020
1 parent 0797222 commit af98e4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ COPY ./app ./
COPY .env ./

ENV TZ=Asia/Shanghai
EXPOSE 8989
EXPOSE 80

ENTRYPOINT ["./app"]
ENTRYPOINT ["./app",":80"]
6 changes: 5 additions & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
Expand All @@ -16,6 +17,9 @@ import (
)

func main() {
port := flag.String("addr", ":8989", "addr ip:port")
flag.Parse()

m, err := dotenv.Read()

if err != nil {
Expand Down Expand Up @@ -93,7 +97,7 @@ func main() {

http.Handle("/genapi/struct/gen", c.Handler(handler))

err = http.ListenAndServe(":8989",nil)
err = http.ListenAndServe(*port, nil)

if err != nil {
log.Fatal("ListenAndServe", err)
Expand Down

0 comments on commit af98e4a

Please sign in to comment.