DEVELOPMENT ENVIRONMENT

~liljamo/tixe

ref: aa4ffd5f5c60de5710703f6dd6bd18fcabd6a0e1 tixe/Dockerfile -rw-r--r-- 480 bytes
aa4ffd5fJonni Liljamo feat: make docker build cache deps builds 1 year, 2 months 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
# builder
FROM golang:1.20.1-alpine AS builder

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=0 GOOS=linux go build -v -o /tixe ./tixe.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 /tixe /tixe
ADD ./static /static

EXPOSE 8080

ENTRYPOINT ["/tixe"]