We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a028e0e commit 116ecacCopy full SHA for 116ecac
Dockerfile
@@ -1,31 +1,11 @@
1
-# Stage 1: Build
2
-FROM golang:1.22 AS builder
3
-
4
-WORKDIR /app
5
6
-# Copy Go modules and source files
7
8
-# Build the Go binary
9
-RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o main
10
11
-RUN go mod download
12
13
14
-RUN ls -la
15
16
-RUN pwd
17
18
-# Stage 2: Package
19
FROM alpine:latest
20
21
-# Copy the built binary from the builder stage
22
-COPY --from=builder /app/main .
+# Copy only the required directories and files
+COPY main ./main
+
23
24
-# Give execution permissions
25
-RUN chmod +x /main
+RUN chmod 777 /main
26
27
-# Expose the application port
28
EXPOSE 8000
29
30
-# Command to run the application
31
-CMD ["/main"]
+CMD ["/main"]
0 commit comments