forked from massivebox/ecodash
Refactor
This commit is contained in:
parent
08be78f907
commit
9bd3f35cc7
8 changed files with 403 additions and 150 deletions
25
Dockerfile
25
Dockerfile
|
@ -1,14 +1,23 @@
|
|||
FROM golang:1.19
|
||||
FROM golangci/golangci-lint:latest-alpine
|
||||
FROM golang:alpine
|
||||
|
||||
RUN mkdir -p /app
|
||||
COPY --from=0 /usr/bin/golangci-lint /usr/bin/golangci-lint
|
||||
RUN apk add --no-cache gcc libc-dev
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
COPY src /app/
|
||||
|
||||
RUN rm -rf go.mod go.sum config.json cache.json; \
|
||||
touch config.json; \
|
||||
go mod init ecodash; \
|
||||
go mod tidy
|
||||
RUN go build -o app .
|
||||
RUN golangci-lint run
|
||||
RUN go test ./src/...
|
||||
|
||||
RUN CGO_ENABLED=1 go build -o app src/main.go
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=1 /app/app .
|
||||
COPY ./templates /app/templates
|
||||
RUN touch config.json
|
||||
|
||||
CMD ["./app"]
|
Loading…
Add table
Add a link
Reference in a new issue