ecodash/Dockerfile

26 lines
471 B
Docker
Raw Normal View History

2023-05-01 16:33:15 +00:00
FROM golangci/golangci-lint:latest-alpine
FROM golang:alpine
2022-10-15 17:58:44 +00:00
2023-05-01 16:33:15 +00:00
COPY --from=0 /usr/bin/golangci-lint /usr/bin/golangci-lint
RUN apk add --no-cache gcc libc-dev
2022-10-15 17:58:44 +00:00
WORKDIR /app
2023-05-01 17:25:16 +00:00
COPY src /app/src
COPY go.mod /app/
COPY go.sum /app/
COPY .golangci.yml /app/
2022-10-15 17:58:44 +00:00
2023-05-01 16:33:15 +00:00
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
2022-10-15 17:58:44 +00:00
CMD ["./app"]