-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (40 loc) · 1.15 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
50
FROM surnet/alpine-wkhtmltopdf:3.17.0-0.12.6-full as wkhtmltopdf
FROM golang:1.21-alpine as builder
RUN mkdir /build
WORKDIR /build
COPY . .
ENV GOOS=linux GOARCH=amd64 CGO_ENABLED=0
RUN go install -v ./...
RUN go install -v github.com/rubenv/sql-migrate/sql-migrate@v1.4.0
FROM alpine:3.17.3
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
echo http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \
echo http://dl-cdn.alpinelinux.org/alpine/v3.8/main >> /etc/apk/repositories
RUN apk update && \
apk add --no-cache \
bash \
openssl-dev \
tzdata
RUN apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
ttf-ubuntu-font-family
RUN ln -fs /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /usr/bin/wkhtmltopdf
RUN chmod +x /usr/bin/wkhtmltopdf
WORKDIR /
COPY --from=builder /go/bin/* /usr/bin/
COPY migrations /migrations
COPY dbconfig.yml /
COPY pkg/templates /templates
ENTRYPOINT [ "server" ]