forked from mstgnz/cdn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
47 lines (43 loc) · 1.24 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
FROM golang:1.21 as builder
# Ignore APT warnings about not having a TTY
ENV DEBIAN_FRONTEND=noninteractive \
IMAGEMAGICK_VERSION=7.1.1-33
RUN apt-get update \
&& apt-get install -y \
wget build-essential \
ffmpeg \
pkg-config \
libmagickcore-dev libmagickwand-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libgif-dev \
libx11-dev \
fontconfig fontconfig-config libfontconfig1-dev \
ghostscript gsfonts gsfonts-x11 \
libfreetype6-dev \
vim \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
RUN echo "Installing ImageMagick" && cd && \
wget https://download.imagemagick.org/ImageMagick/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz && \
tar xvzf ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz && \
cd ImageMagick* && \
./configure \
--without-magick-plus-plus \
--without-perl \
--disable-openmp \
--with-gvc=no \
--with-fontconfig=yes \
--with-freetype=yes \
--with-gslib \
--disable-docs && \
echo "Building ImageMagick" && \
make -j$(nproc) && make install && \
ldconfig /usr/local/lib
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOOS=linux go build -o CdnApp ./cmd
ENTRYPOINT ["/app/CdnApp"]