File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ FROM golang:1.21 AS builder
22RUN apt-get update && apt-get upgrade -y && apt-get install build-essential -y
33WORKDIR /app
44COPY . .
5- RUN CGO_ENABLED=0 GOOS=` go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build ./cmd/fsb/ -o out/ fsb -ldflags="-w -s" .
5+ RUN CGO_ENABLED=0 go build -o /app/ fsb -ldflags="-w -s" ./cmd/fsb
66
7- FROM golang:1.21
8- COPY --from=builder /app/out/fsb /app/fsb
9- CMD ["/app/fsb" ]
7+ FROM scratch
8+ COPY --from=builder /app/fsb /app/fsb
9+ EXPOSE ${PORT}
10+ ENTRYPOINT ["/app/fsb" ]
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ services:
55 build :
66 context : .
77 dockerfile : Dockerfile
8- restart : always
98 container_name : fsb
9+ restart : always
1010 volumes :
11- - ./:/app/:rw
12- env_file : fsb.env
11+ - ./logs:/app/logs
12+ env_file :
13+ - fsb.env
1314 ports :
14- - 8080:8080
15+ - " ${PORT:-8038}:${PORT:-8038} "
You can’t perform that action at this time.
0 commit comments