dongsii commited on
Commit
de8f299
·
verified ·
1 Parent(s): 4237d44

Create Dockerfile

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