-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (29 loc) · 690 Bytes
/
Dockerfile
File metadata and controls
48 lines (29 loc) · 690 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# # Build stage
# FROM golang:1.21-alpine AS build
# RUN apk update && \
# apk add --no-cache git
# WORKDIR /app
# COPY go.mod go.sum ./
# RUN go mod download
# COPY . .
# RUN go build -o main
# # Final image
# FROM alpine
# RUN apk update && \
# apk add --no-cache ca-certificates
# WORKDIR /app
# COPY --from=build /app/main .
# EXPOSE 3000
# CMD ["./main"]
FROM golang:alpine
RUN apk update && apk upgrade && \
apk add --no-cache git
RUN mkdir /app
WORKDIR /app
ADD go.mod .
ADD go.sum .
RUN go mod download
ADD . .
RUN go install -mod=mod github.com/githubnemo/CompileDaemon
EXPOSE 3000
ENTRYPOINT CompileDaemon --build="go build main.go" --command=./main