ShreeshantXD commited on
Commit
287d2a3
·
1 Parent(s): 30aa472

fix: use golang:1.21 instead of alpine for better Docker registry compatibility

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -1,13 +1,13 @@
1
  # Stage 1: Build the Go environment server
2
- FROM golang:1.21-alpine AS builder
3
 
4
  WORKDIR /app
5
  COPY go.mod go.sum* ./
6
- RUN go mod download 2>/dev/null || true && go mod verify 2>/dev/null || true
7
 
8
  COPY main.go ./
9
  COPY env/ ./env/
10
- RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gridmind-server main.go
11
 
12
  # Stage 2: Final image with Python runtime and Dashboard
13
  FROM python:3.11-slim
 
1
  # Stage 1: Build the Go environment server
2
+ FROM golang:1.21 AS builder
3
 
4
  WORKDIR /app
5
  COPY go.mod go.sum* ./
6
+ RUN go mod download || true
7
 
8
  COPY main.go ./
9
  COPY env/ ./env/
10
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o gridmind-server main.go
11
 
12
  # Stage 2: Final image with Python runtime and Dashboard
13
  FROM python:3.11-slim