forked from RedHatInsights/catalog-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (33 loc) · 1.18 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
FROM manageiq/ruby:latest
RUN yum -y install centos-release-scl-rh && \
yum -y install --setopt=tsflags=nodocs \
# To compile native gem extensions
gcc-c++ \
# For git based gems
git \
# For checking service status
nmap-ncat \
# To compile pg gem
rh-postgresql10-postgresql-devel \
rh-postgresql10-postgresql-libs \
&& \
yum clean all
ENV WORKDIR /opt/catalog-api/
ENV RAILS_ROOT $WORKDIR
WORKDIR $WORKDIR
COPY Gemfile $WORKDIR
RUN source /opt/rh/rh-postgresql10/enable && \
echo "gem: --no-document" > ~/.gemrc && \
gem install bundler --conservative --without development:test && \
bundle install --jobs 8 --retry 3 && \
find ${RUBY_GEMS_ROOT}/gems/ | grep "\.s\?o$" | xargs rm -rvf && \
rm -rvf ${RUBY_GEMS_ROOT}/cache/* && \
rm -rvf /root/.bundle/cache
COPY . $WORKDIR
COPY docker-assets/entrypoint /usr/bin
COPY docker-assets/run_rails_server /usr/bin
RUN chgrp -R 0 $WORKDIR && \
chmod -R g=u $WORKDIR
EXPOSE 3000
ENTRYPOINT ["entrypoint"]
CMD ["run_rails_server"]