From a4b34d49431a92a26222405e2af4870aa0283268 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Tue, 14 May 2024 00:00:28 -0600 Subject: [PATCH] Docker-ify? --- Dockerfile | 14 ++++++++++++++ docker-compose.yml | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..19e04f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.22.0 as build + +WORKDIR /app + +COPY . . + +RUN go mod download +RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /go/bin/app + +FROM gcr.io/distroless/base-debian12 + +COPY --from=build /go/bin/app / + +CMD [ "/app" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aaf5890 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' + +services: + app: + build: + context: . + dockerfile: Dockerfile + image: your-app-image:latest + command: ["/app"] + ports: + - "3000:3000" \ No newline at end of file