From b3fdd203ad7bda6a16072a9d717c029d925a0b17 Mon Sep 17 00:00:00 2001 From: raqueeb01 Date: Sat, 11 Jan 2025 18:58:45 +0530 Subject: [PATCH 1/6] docker --- Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e69de29bb From 24e58bd72228a348b33c5348b0e5f8b396699378 Mon Sep 17 00:00:00 2001 From: Abdul Raqueeb Date: Sat, 11 Jan 2025 19:04:51 +0530 Subject: [PATCH 2/6] Update Dockerfile --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Dockerfile b/Dockerfile index e69de29bb..c7d9ec357 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM golang:1.22as base + +# Set the working directory inside the container +WORKDIR /app + +# Copy the go.mod and go.sum files to the working directory +COPY go.mod ./ + +# Download all the dependencies +RUN go mod download + +# Copy the source code to the working directory +COPY . . + +# Build the application +RUN go build -o main . + +####################################################### +# Reduce the image size using multi-stage builds +# We will use a distroless image to run the application +FROM gcr.io/distroless/base + +# Copy the binary from the previous stage +COPY --from=base /app/main . + +# Copy the static files from the previous stage +COPY --from=base /app/static ./static + +# Expose the port on which the application will run +EXPOSE 8080 + +# Command to run the application +CMD ["./main"] From de0bcc01a5b013e1a8f53cfeca129515739b5ab3 Mon Sep 17 00:00:00 2001 From: raqueeb01 Date: Sat, 11 Jan 2025 19:11:20 +0530 Subject: [PATCH 3/6] update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c7d9ec357..42fb5c7d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22as base +FROM golang:1.22 as base # Set the working directory inside the container WORKDIR /app From e28ac3aa3df3aff5ab4022e50720a5cfad3fcec4 Mon Sep 17 00:00:00 2001 From: raqueeb01 Date: Sat, 11 Jan 2025 19:29:49 +0530 Subject: [PATCH 4/6] daaaaa --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d23044355..b25d03c88 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/iam-veeramalla/go-web-app +module https://github.com/iamraqueeb/go-web-app go 1.22.5 From 9fa8cb2b26a6d8c4f8e83b3b1e0bc1f2913ddbcd Mon Sep 17 00:00:00 2001 From: raqueeb01 Date: Sat, 11 Jan 2025 19:43:33 +0530 Subject: [PATCH 5/6] docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 42fb5c7d3..7f5eec998 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22 as base +FROM golang:1.22.5 as base # Set the working directory inside the container WORKDIR /app From ec9dcd17f9753baa0759834eaefbeb27bc1245bb Mon Sep 17 00:00:00 2001 From: raqueeb01 Date: Sat, 11 Jan 2025 19:49:49 +0530 Subject: [PATCH 6/6] base --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7f5eec998..fa0a76fde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22.5 as base +FROM golang:1.22.5 As base # Set the working directory inside the container WORKDIR /app