-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 764 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 764 Bytes
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
31
32
FROM golang:1.16.2-alpine3.13 AS build_base
RUN apk add --no-cache git
# Set the Current Working Directory inside the container
WORKDIR /tmp/app
# We want to populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
RUN go mod download
RUN go get -u github.com/gobuffalo/packr/v2/packr2
COPY . .
# Build the Go app
RUN packr2
RUN apk add pkgconfig imagemagick-dev build-base
RUN go build -o seventv
# Start fresh from a smaller image
FROM alpine
ENV MAGICK_HOME=/usr
RUN apk update && apk add ca-certificates pkgconfig imagemagick libwebp-tools libwebp-dev libpng-dev jpeg-dev giflib-dev
WORKDIR /app
COPY --from=build_base /tmp/app/seventv /app/seventv
# Run the binary program produced by `go install`
CMD ["/app/seventv"]