Refactor project structure: modularized code into pkg and cmd directories, added unit tests, improved CI/CD pipeline, and enhanced documentation.
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -1,11 +1,15 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM golang:1.26-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN go build -o app
|
||||
COPY go.mod .
|
||||
|
||||
FROM alpine:latest
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -o server ./cmd/diunwebhook/main.go
|
||||
|
||||
FROM alpine:3.18
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/app .
|
||||
COPY --from=builder /app/server ./server
|
||||
COPY static ./static
|
||||
EXPOSE 8080
|
||||
CMD ["./app"]
|
||||
CMD ["./server"]
|
||||
|
||||
Reference in New Issue
Block a user