-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (32 loc) · 1.42 KB
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Build stage
FROM golang:1.23-alpine AS build
# Install certificates
RUN apk --no-cache add ca-certificates
# Set the working directory
WORKDIR /app
# Copy the source code
COPY . .
# Build the Go application
RUN go build -ldflags="-s -w" -trimpath -o dist/go-fr cmd/go-fr/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-echo cmd/go-echo/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-bun cmd/go-bun/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-fuego cmd/go-fuego/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-fiber cmd/go-fiber/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-std cmd/go-std/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-std-auto-perf cmd/go-std-auto-perf/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-gin cmd/go-gin/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-gorilla-mux cmd/go-gorilla-mux/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-chi cmd/go-chi/main.go
RUN go build -ldflags="-s -w" -trimpath -o dist/go-hertz cmd/go-hertz/main.go
# Production stage
FROM scratch AS prod
# Set the working directory
WORKDIR /app
# Copy the certificates from the build stage
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy the built binary from the build stage
COPY --from=build /app/dist /app
# Expose the port your application listens on
# EXPOSE 8080
# Run the application
# CMD ["/app/main"]