-
Notifications
You must be signed in to change notification settings - Fork 36
/
Dockerfile
89 lines (71 loc) · 2.43 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
87
88
89
FROM node:16.13.0-bullseye-slim AS node
FROM ruby:3.0.6-slim-bullseye
# for build-dep
RUN echo "deb-src http://deb.debian.org/debian bullseye main" >> /etc/apt/sources.list
RUN echo "deb-src http://deb.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list
RUN echo "deb-src http://deb.debian.org/debian bullseye-updates main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
postgresql-client \
libicu-dev \
libwebp-dev \
libopenjp2-7-dev \
librsvg2-dev \
libde265-dev \
git \
curl \
wget && \
apt-get clean && \
apt-get autoremove
RUN apt build-dep -y imagemagick && \
wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-15.tar.gz && \
tar xf 7.1.1-15.tar.gz && \
cd ImageMagick-7* && \
./configure && \
make && \
make install && \
ldconfig
ENV YARN_VERSION=v1.22.15
# node install
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /opt/yarn-${YARN_VERSION} /opt/yarn
RUN ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
ARG RAILS_ENV="production"
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
BUNDLER_JOBS=4 \
BUNDLER_VERSION=2.2.33 \
APP_HOME=/app \
RAILS_ENV=${RAILS_ENV} \
RAILS_LOG_TO_STDOUT=true \
RAILS_SERVE_STATIC_FILES=true \
SECRET_KEY_BASE=placeholder \
SLACK_API_TOKEN=xoxbdummy
WORKDIR $APP_HOME
COPY Gemfile Gemfile.lock ./
COPY omniauth-line_login /app/omniauth-line_login
COPY decidim-user_extension /app/decidim-user_extension
# bundle install
RUN gem install bundler:${BUNDLER_VERSION} \
&& bundle config --global jobs ${BUNDLER_JOBS} \
&& if [ "${RAILS_ENV}" = "production" ];then \
bundle install --without development test \
;else \
bundle install \
;fi
COPY . $APP_HOME
RUN cp ./entrypoint /usr/bin/entrypoint \
&& chmod +x /usr/bin/entrypoint \
&& chmod -R +x ./bin/
RUN yarn install \
&& ./bin/rails assets:precompile \
&& yarn cache clean
ENTRYPOINT ["entrypoint"]
EXPOSE 3000
CMD ["./bin/rails", "s", "-b", "0.0.0.0"]