ecodash/Dockerfile

28 lines
543 B
Docker
Raw Permalink Normal View History

2023-05-01 18:33:15 +02:00
FROM golangci/golangci-lint:latest-alpine
FROM golang:alpine
2022-10-15 19:58:44 +02:00
2023-05-01 18:33:15 +02:00
COPY --from=0 /usr/bin/golangci-lint /usr/bin/golangci-lint
RUN apk add --no-cache gcc libc-dev
2022-10-15 19:58:44 +02:00
WORKDIR /app
2023-05-01 19:25:16 +02:00
COPY src /app/src
COPY go.mod /app/
COPY .golangci.yml /app/
2022-10-15 19:58:44 +02:00
2024-04-12 21:40:22 +02:00
RUN go mod tidy; \
golangci-lint run; \
go test ./src/...
2023-05-01 19:39:12 +02:00
RUN CGO_ENABLED=1 go build -o app src/main/main.go
2023-05-01 18:33:15 +02:00
FROM alpine:latest
WORKDIR /app
COPY --from=1 /app/app .
COPY ./templates /app/templates
2022-10-15 19:58:44 +02:00
2024-04-12 21:40:22 +02:00
RUN mkdir data
ENV DATABASE_PATH=./data/database.db
ENV CONFIG_PATH=./data/config.json
CMD "./app"