This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (55 loc) · 2.41 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
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM ruby:3.0.2-alpine3.13
# Install mozjpeg & libvips
ARG LIBVIPS_VERSION_MAJOR_MINOR=8.9
ARG LIBVIPS_VERSION_PATCH=1
ARG MOZJPEG_VERSION="v3.3.1"
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.11/community" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add --update \
zlib libxml2 libxslt glib libexif lcms2 fftw ca-certificates \
giflib libpng libwebp orc tiff poppler-glib librsvg && \
\
apk add --no-cache --virtual .build-dependencies autoconf automake build-base cmake \
git libtool nasm zlib-dev libxml2-dev libxslt-dev glib-dev \
libexif-dev lcms2-dev fftw-dev giflib-dev libpng-dev libwebp-dev orc-dev tiff-dev \
poppler-dev librsvg-dev wget && \
\
echo 'Install mozjpeg' && \
cd /tmp && \
git clone https://github.com/mozilla/mozjpeg.git && \
cd /tmp/mozjpeg && \
git checkout ${MOZJPEG_VERSION} && \
autoreconf -fiv && ./configure --prefix=/usr && make install && \
\
echo 'Install libvips' && \
wget -O- https://github.com/libvips/libvips/releases/download/v${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH}/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH}.tar.gz | tar xzC /tmp && \
cd /tmp/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH} && \
./configure --prefix=/usr \
--without-gsf \
--enable-debug=no \
--disable-dependency-tracking \
--disable-static \
--enable-silent-rules && \
make -s install-strip && \
cd $OLDPWD && \
\
echo 'Cleanup' && \
rm -rf /tmp/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH} && \
rm -rf /tmp/mozjpeg && \
apk del --purge .build-dependencies && \
rm -rf /var/cache/apk/*
RUN apk --update --no-cache add curl openssh-client postgresql-dev libffi-dev libxml2-dev libxslt-dev libwebp-dev
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
RUN bundle config build.nokogiri --use-system-libraries
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ADD Gemfile /usr/src/app/
ADD Gemfile.lock /usr/src/app/
RUN apk --update --no-cache add git build-base pkgconfig\
&& RAILS_ENV=production bundle install --deployment --frozen --clean --without development test --path vendor/bundle\
&& apk del git pkgconfig build-base
COPY . /usr/src/app
EXPOSE 3000
CMD ["./bin/rails", "server", "-b", "0.0.0.0"]