File size: 484 Bytes
bf98406
 
 
 
 
 
 
 
8c1976c
bf98406
 
 
 
 
 
8c1976c
bf98406
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Dockerfile (modified for development with 'air')
FROM golang:1.24.2-alpine AS builder

WORKDIR /app

ENV GO111MODULE=on \
    CGO_ENABLED=0

# for live reload inside the container
RUN go install github.com/air-verse/air@latest

COPY go.mod go.sum ./

RUN go mod download

#  no build for development, air will handle it
# COPY . .
# RUN go build -o /app/niyam -ldflags "-s -w" ./main.go

# ---

FROM scratch

WORKDIR /app
COPY --from=builder /app/niyam .
EXPOSE 8080
CMD ["./niyam"]