-
Notifications
You must be signed in to change notification settings - Fork 86
/
Dockerfile.oracle
101 lines (77 loc) · 2.61 KB
/
Dockerfile.oracle
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FROM ruby:3.2.5-slim-bullseye
RUN mkdir -p /opt/homs
RUN mkdir -p /opt/oracle
RUN useradd --uid 2004 --home /opt/homs --shell /bin/bash --comment "HOMS" homs && \
chown -R homs /opt/homs
COPY --chown=homs instantclient*.zip /opt/oracle/
RUN apt-get update -q && \
apt-get purge -y cmdtest && \
apt-get install --no-install-recommends -yq wget gnupg
RUN wget -O - http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
wget -qO- https://deb.nodesource.com/setup_18.x | bash -
RUN seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} && \
apt-get update && \
apt-get install --no-install-recommends -y \
build-essential \
curl \
git \
libaio1 \
libpq-dev \
libxml2 \
libxml2-dev \
libxslt-dev \
make \
nodejs \
pkg-config \
postgresql-client \
ruby-dev \
telnet \
unzip \
yarn
WORKDIR /opt/oracle
RUN unzip 'instantclient*.zip' && \
cd /opt/oracle/instantclient_11_2 && \
ln -s libclntsh.so.11.1 libclntsh.so && \
ln -s libocci.so.11.1 libocci.so && \
ln -s libsqora.so.11.1 libsqora.so
ENV TNS_ADMIN /etc/oracle/
ENV LD_LIBRARY_PATH /opt/oracle/instantclient_11_2
ENV DYLD_LIBRARY_PATH /opt/oracle/instantclient_11_2
ENV NLS_LANG AMERICAN_RUSSIA.AL32UTF8
USER homs
WORKDIR /opt/homs
COPY --chown=homs Gemfile Gemfile.lock Rakefile config.ru package.json yarn.lock .eslintrc .babelrc tsconfig.json /opt/homs/
COPY --chown=homs hbw/*.gemspec /opt/homs/hbw/
COPY --chown=homs hbw/lib/hbw/ /opt/homs/hbw/lib/hbw/
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1
ENV REDIS_HOST redis
ENV REDIS_PORT 6379
RUN gem install bundler
RUN bundle config --global frozen 1
RUN bundle --with oracle --without test
COPY --chown=homs app/ /opt/homs/app/
COPY --chown=homs bin/ /opt/homs/bin/
COPY --chown=homs config/ /opt/homs/config/
COPY --chown=homs db/ /opt/homs/db/
COPY --chown=homs fixtures/ /opt/homs/fixtures/
COPY --chown=homs lib/ /opt/homs/lib/
COPY --chown=homs public/ /opt/homs/public/
COPY --chown=homs spec/ /opt/homs/spec/
COPY --chown=homs vendor/ /opt/homs/vendor/
COPY --chown=homs hbw/ /opt/homs/hbw/
COPY ./entrypoint.sh ./wait_for_postgres.sh /
USER root
ARG VERSION
RUN echo $VERSION > /opt/homs/VERSION
RUN find config -name '*.sample' | xargs -I{} sh -c 'cp $1 ${1%.*}' -- {}
RUN mkdir /tmp/config
RUN cp -r /opt/homs/config/* /tmp/config
EXPOSE 3000
USER homs
RUN yarn install && \
yarn build && \
rm -rf /opt/homs/node_modules/
ENV RAILS_ENV=production
WORKDIR /opt/homs
ENTRYPOINT ["/entrypoint.sh"]