-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
53 lines (43 loc) · 1.66 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
FROM registry.access.redhat.com/ubi8/ubi:8.4
RUN dnf -y --disableplugin=subscription-manager module enable ruby:2.6 && \
dnf -y --disableplugin=subscription-manager --setopt=tsflags=nodocs install \
# ruby 2.6 via module
ruby-devel \
# build utilities
gcc-c++ git make redhat-rpm-config \
# libraries
postgresql-devel openssl-devel libxml2-devel jq \
#ImageMagick deps
autoconf libpng-devel libjpeg-devel librsvg2 \
# For the rdkafka gem
cyrus-sasl-devel zlib-devel openssl-devel diffutils && \
dnf clean all
# Compile ImageMagick 6 from source.
COPY docker-assets/ImageMagick6-6.9.10-90.tar.gz /tmp/
RUN cd /tmp/ && tar -xf ImageMagick6-6.9.10-90.tar.gz && cd ImageMagick6-6.9.10-90 && \
./configure --prefix=/usr --disable-docs && \
make install && \
cd $WORKDIR && rm -rvf /tmp/ImageMagick*
COPY docker-assets/librdkafka-1.5.0.tar.gz /tmp/librdkafka.tar.gz
RUN cd /tmp && tar -xf /tmp/librdkafka.tar.gz && cd librdkafka-1.5.0 && \
./configure --prefix=/usr && \
make -j2 && make install && \
rm -rf /tmp/librdkafka*
ENV WORKDIR /opt/catalog-api/
ENV RAILS_ROOT $WORKDIR
WORKDIR $WORKDIR
COPY Gemfile $WORKDIR
RUN echo "gem: --no-document" > ~/.gemrc && \
gem install bundler --conservative --without development:test && \
bundle install --jobs 8 --retry 3 && \
rm -rvf $(gem env gemdir)/cache/* && \
rm -rvf /root/.bundle/cache
COPY . $WORKDIR
COPY docker-assets/entrypoint /usr/bin
COPY docker-assets/run_rails_server /usr/bin
RUN touch /opt/rdsca.crt && chmod 666 /opt/rdsca.crt
RUN chgrp -R 0 $WORKDIR && \
chmod -R g=u $WORKDIR
EXPOSE 3000
ENTRYPOINT ["entrypoint"]
CMD ["run_rails_server"]