dongsii commited on
Commit
185e622
·
verified ·
1 Parent(s): 4ccf7e9

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ===== BUILD STAGE =====
2
+ FROM golang:1.22-alpine AS builder
3
+
4
+ WORKDIR /app
5
+ COPY go.mod go.sum ./
6
+ RUN go mod download
7
+
8
+ COPY . .
9
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app
10
+
11
+ # ===== RUNTIME STAGE =====
12
+ FROM alpine:latest
13
+
14
+ WORKDIR /app
15
+ COPY --from=builder /app/app .
16
+
17
+ ENV PORT=7860
18
+ EXPOSE 7860
19
+
20
+ CMD ["./app"]