mastering bridging
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
# Build stage
|
||||
FROM golang:1.21 AS build-env
|
||||
ENV GO111MODULE=on
|
||||
|
||||
# Set /app as the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy all files to /app
|
||||
COPY . .
|
||||
COPY .env .env
|
||||
|
||||
# Install dependencies
|
||||
RUN go mod download && go mod verify
|
||||
RUN go mod tidy -v
|
||||
|
||||
# Build the Go application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -v -installsuffix cgo -o app cmd/main.go
|
||||
|
||||
# final
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get -y install wget
|
||||
|
||||
|
||||
COPY --from=build-env /app/app .
|
||||
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
# Define the command to run the application
|
||||
CMD ["./app"]
|
||||
Reference in New Issue
Block a user