Created
June 6, 2022 17:16
-
-
Save MarlikAlmighty/5bbb2038fabd09e2657cad3359b0f37b to your computer and use it in GitHub Desktop.
Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.18 AS builder | |
# Ignore APT warnings about not having a TTY | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
wget build-essential \ | |
pkg-config \ | |
--no-install-recommends \ | |
&& apt-get -q -y install \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libtiff-dev \ | |
libgif-dev \ | |
libx11-dev \ | |
fontconfig fontconfig-config libfontconfig1-dev \ | |
ghostscript gsfonts gsfonts-x11 \ | |
libfreetype6-dev \ | |
--no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* | |
ARG IMAGEMAGICK_PROJECT=ImageMagick6 | |
ARG IMAGEMAGICK_VERSION=6.9.10-11 | |
ENV IMAGEMAGICK_VERSION=$IMAGEMAGICK_VERSION | |
RUN cd && \ | |
wget https://github.com/ImageMagick/${IMAGEMAGICK_PROJECT}/archive/${IMAGEMAGICK_VERSION}.tar.gz && \ | |
tar xvzf ${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 && \ | |
make -j$(nproc) && make install && \ | |
ldconfig /usr/local/lib | |
WORKDIR /go/src/captcha | |
COPY . . | |
RUN go mod tidy && go build -o /go/src/captcha/app /go/src/captcha/cmd/captcha-api-server/main.go | |
FROM scratch | |
COPY --from=builder /go/src/captcha/app /app | |
EXPOSE 3000/tcp | |
CMD ["/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment