-
Notifications
You must be signed in to change notification settings - Fork 86
/
Dockerfile
86 lines (64 loc) · 2.19 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM ruby:3.2.5-slim-bullseye
RUN mkdir -p /opt/homs
RUN useradd --uid 2004 --home /opt/homs --shell /bin/bash --comment "HOMS" homs && \
chown -R homs /opt/homs
RUN apt-get update -q && \
apt-get purge -y cmdtest && \
apt-get install --no-install-recommends -yq wget gnupg
RUN seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} && \
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 apt-get update && apt-get install --no-install-recommends -y \
build-essential \
curl \
git \
libpq-dev \
libxml2-dev \
libxml2 \
libxslt-dev \
make \
nodejs \
postgresql-client \
pkg-config \
ruby-dev \
telnet \
yarn
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 --without oracle 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 --chown=homs ./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 chown -R homs /opt/homs/config
RUN cp -r /opt/homs/config/* /tmp/config
EXPOSE 3000
USER homs
RUN yarn install && \
yarn lint && \
yarn build && \
rm -rf /opt/homs/node_modules/
WORKDIR /opt/homs
ENTRYPOINT ["/entrypoint.sh"]