-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (30 loc) · 781 Bytes
/
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
44
45
46
47
48
49
50
51
52
53
# syntax=docker/dockerfile:1
##
## Build the application from source
##
FROM golang:1.21 AS build-stage
WORKDIR /app/cmd
#Adjusted WORKDIR to the subdirectory
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
# Copy the entire project (including cmd directory)
RUN CGO_ENABLED=0 GOOS=linux go build -o /docker-muse-registry ./cmd
# Specify the cmd directory
##
## Run the tests in the container
##
FROM build-stage AS run-test-stage
RUN go test -v ./...
##
## Deploy the application binary into a lean image
##
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /docker-muse-registry /sveltego
# Updated binary path
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/sveltego"]
# Adjusted binary name