From 8a5f9d81bdaa1283fd7cb6f33fb53657f334b08c Mon Sep 17 00:00:00 2001 From: abhinav29102005 Date: Sun, 27 Sep 2026 15:36:03 +0530 Subject: [PATCH 1/2] chore: optimize Dockerfile for faster builds and smallest storage --- backend/Dockerfile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 3cb11fb..d19e49c 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,23 +1,29 @@ -FROM golang:1.20.4-alpine AS build +# Start with a very fast and tiny base for building +FROM golang:1.21-alpine AS build WORKDIR /app -COPY go.mod ./ -COPY go.sum ./ +# Enable Go modules and caching for much faster rebuilds +ENV GO111MODULE=on +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOARCH=amd64 + +# Copy only mod files first to cache dependencies (this makes subsequent builds INSTANT) +COPY go.mod go.sum ./ RUN go mod download +# Copy the rest of the code COPY ./ ./ -RUN go build -o main.exe main.go +# Build a strictly static, highly optimized binary (-s -w strips debugging info to reduce file size heavily) +RUN go build -ldflags="-s -w" -o main.exe main.go +# Second stage: The absolute smallest possible container (Zero OS overhead) FROM scratch WORKDIR /app COPY --from=build /app/main.exe ./ COPY --from=build /app/go-templates/ ./go-templates/ -LABEL traefik.port=80 -LABEL traefik.http.routers.link.rule="Host(`l.mlsctiet.com`)" -LABEL traefik.http.routers.link.tls=true -LABEL traefik.http.routers.link.tls.certresolver="lets-encrypt" -LABEL org.opencontainers.image.source="https://github.com/MicrosoftStudentChapter/link-generator" + EXPOSE 4000 -CMD [ "./main.exe" ] \ No newline at end of file +CMD [ "./main.exe" ] From e4e2fedf2d147677c99f66c0ef61434b34174af1 Mon Sep 17 00:00:00 2001 From: abhinav29102005 Date: Sun, 27 Sep 2026 16:12:37 +0530 Subject: [PATCH 2/2] feat: add MainContentSection component for URL shortening functionality --- frontend/src/Maincontent.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Maincontent.jsx b/frontend/src/Maincontent.jsx index 9f5c8b9..0ecb12d 100644 --- a/frontend/src/Maincontent.jsx +++ b/frontend/src/Maincontent.jsx @@ -49,7 +49,7 @@ const MainContentSection = () => { const shortenedUrl = generateShortenedUrl(alias); - const link = "https://l.mlsctiet.com" + const link = "https://linky-backend.abhinavkumarsingh.tech" // api call to add link in the backend const raw = JSON.stringify({