Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #56

Merged
merged 7 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# syntax=docker/dockerfile:1

FROM golang:1.21 as build

COPY . /root
WORKDIR /root

# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /durabletask-go

FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /durabletask-go /

EXPOSE 4001

# Run
ENTRYPOINT [ "/durabletask-go" ]
CMD [ "--host", "0.0.0.0", "--port", "4001" ]
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

var (
port = flag.Int("port", 4001, "The server port")
host = flag.String("host", "localhost", "The host to bind to")
dbFilePath = flag.String("db", "", "The path to the sqlite file to use (or create if not exists)")
ctx = context.Background()
)
Expand All @@ -29,7 +30,7 @@ func main() {
log.Fatalf("failed to start worker: %v", err)
}

lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port))
lis, err := net.Listen("tcp", fmt.Sprintf("%s:%d", *host, *port))
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
Expand Down
Loading