all repos — albus-go @ 1bfa2838c5f0158361bf532c8766cbef2d4efb23

Dockerfile (view raw)

 1# syntax=docker/dockerfile:1
 2
 3FROM golang:alpine AS builder
 4
 5WORKDIR /build
 6
 7# Download Go modules
 8COPY ./telegram-bot-api ./telegram-bot-api
 9COPY go.mod go.su[m] ./
10RUN go mod download
11
12# Transfer source code
13
14
15COPY *.go ./
16
17# Build
18RUN CGO_ENABLED=0 go build -trimpath -o /dist/app
19
20# Test
21FROM build-stage AS run-test-stage
22RUN go test -v ./...
23
24FROM alpine:latest AS build-release-stage
25
26RUN apk update && \
27    apk add --no-cache \
28    pandoc \
29    tectonic
30
31#COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
32COPY --from=builder /dist /app
33
34WORKDIR /app
35
36ENTRYPOINT ["/app/app"]