Skip to content

Commit

Permalink
fix(docker): runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
EverythingSuckz committed Dec 1, 2023
1 parent 786c6d1 commit c257293
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM golang:1.21 AS builder
RUN apt-get update && apt-get upgrade -y && apt-get install build-essential -y
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build ./cmd/fsb/ -o out/fsb -ldflags="-w -s" .
RUN CGO_ENABLED=0 go build -o /app/fsb -ldflags="-w -s" ./cmd/fsb

FROM golang:1.21
COPY --from=builder /app/out/fsb /app/fsb
CMD ["/app/fsb"]
FROM scratch
COPY --from=builder /app/fsb /app/fsb
EXPOSE ${PORT}
ENTRYPOINT ["/app/fsb"]
9 changes: 5 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ services:
build:
context: .
dockerfile: Dockerfile
restart: always
container_name: fsb
restart: always
volumes:
- ./:/app/:rw
env_file: fsb.env
- ./logs:/app/logs
env_file:
- fsb.env
ports:
- 8080:8080
- "${PORT:-8038}:${PORT:-8038}"

0 comments on commit c257293

Please sign in to comment.