forked from jiro4989/textimg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (37 loc) · 1.69 KB
/
Dockerfile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ARG GO_VERSION="1.16"
FROM golang:${GO_VERSION}-alpine3.13 AS base
RUN go version \
&& echo $GOPATH \
&& apk update \
&& apk add --no-cache git wget unzip fontconfig alpine-sdk bash \
&& wget https://github.com/tomokuni/Myrica/raw/master/product/MyricaM.zip -q -O /tmp/MyricaM.zip \
&& (cd /tmp && unzip MyricaM.zip) \
&& git clone https://github.com/googlefonts/noto-emoji /usr/local/src/noto-emoji \
&& wget https://www.wfonts.com/download/data/2016/04/23/symbola/symbola.zip -q -O /tmp/symbola.zip \
&& (cd /tmp && unzip symbola.zip)
################################################################################
FROM base AS builder
COPY . /app
WORKDIR /app
RUN go install
################################################################################
FROM base AS coverage
RUN go get \
github.com/onsi/gomega \
github.com/onsi/ginkgo \
golang.org/x/tools/cmd/cover \
;
################################################################################
FROM alpine:latest AS runtime
COPY --from=builder /go/bin/textimg /usr/local/bin/
COPY --from=builder /tmp/MyricaM.TTC /usr/share/fonts/truetype/myrica/MyricaM.TTC
COPY --from=builder /usr/local/src/noto-emoji/png/128 /usr/share/emoji-image
COPY --from=builder /tmp/Symbola_hint.ttf /usr/share/fonts/truetype/symbola/
COPY --from=builder /tmp/Symbola_hint.ttf /usr/share/fonts/truetype/ancient-scripts/
ENV TEXTIMG_OUTPUT_DIR /images
ENV TEXTIMG_FONT_FILE /usr/share/fonts/truetype/myrica/MyricaM.TTC
ENV TEXTIMG_EMOJI_DIR /usr/share/emoji-image
ENV TEXTIMG_EMOJI_FONT_FILE /usr/share/fonts/truetype/symbola/Symbola_hint.ttf
ENV LANG ja_JP.UTF-8
RUN mkdir /images
ENTRYPOINT ["/usr/local/bin/textimg"]