DEVELOPMENT ENVIRONMENT

~liljamo/felu

ref: 1e596cec12a5c40a210a67fd8106d84ee007b1bc felu/Dockerfile -rw-r--r-- 596 bytes
1e596cecJonni Liljamo feat: show users in a table 1 year, 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# builder
FROM golang:1.21.3-alpine3.18 AS builder

RUN apk update && apk add gcc musl-dev

ARG VERSION=notset-dockerfile

WORKDIR /usr/src/app

COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .

RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=1 GOOS=linux go build -ldflags=-X=main.version=${VERSION} -v -o /felu ./*.go

# tester
FROM builder AS tester
RUN --mount=type=cache,target=/root/.cache/go-build go test -v ./...

# release
FROM alpine:3.18 AS release

COPY --from=builder /felu /felu
ADD ./static /static

RUN mkdir /var/felu

ENTRYPOINT ["/felu"]