This commit is contained in:
Daniil Gentili 2023-05-01 18:33:15 +02:00
parent 08be78f907
commit 9bd3f35cc7
Signed by: danog
GPG key ID: 8C1BE3B34B230CA7
8 changed files with 403 additions and 150 deletions

View file

@ -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"]