-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-dev
More file actions
29 lines (18 loc) · 777 Bytes
/
Dockerfile-dev
File metadata and controls
29 lines (18 loc) · 777 Bytes
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
FROM docker.io/library/golang:1.25.4 AS builder
WORKDIR /app
# Copy go mod and sum files
COPY ./src/go.mod ./src/go.sum ./
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download
# Copy the source from the current directory to the Working Directory inside the container
COPY ./src/ ./
# Build the Go app
RUN go build -o url-finder .
FROM docker.io/library/golang:1.25.4
WORKDIR /app
RUN go install github.com/go-delve/delve/cmd/dlv@v1.25.2
# Copy the Pre-built binary file from the previous stage
COPY ./examples/ /app/examples/
COPY --from=builder /app/url-finder /app
EXPOSE 40000
CMD ["dlv", "exec", "/app/url-finder", "--headless", "--listen=:40000", "--api-version=2", "--", "/app/examples/"]