26 lines
486 B
Docker
26 lines
486 B
Docker
FROM golangci/golangci-lint:latest-alpine
|
|
FROM golang:alpine
|
|
|
|
COPY --from=0 /usr/bin/golangci-lint /usr/bin/golangci-lint
|
|
RUN apk add --no-cache gcc libc-dev
|
|
|
|
WORKDIR /app
|
|
COPY src /app/src
|
|
COPY go.mod /app/
|
|
COPY .golangci.yml /app/
|
|
|
|
RUN go mod tidy
|
|
RUN golangci-lint run
|
|
RUN go test ./src/...
|
|
|
|
RUN CGO_ENABLED=1 go build -o app src/main/main.go
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=1 /app/app .
|
|
COPY ./templates /app/templates
|
|
RUN touch config.json database.db
|
|
|
|
CMD ["./app"] |