-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
53 lines (48 loc) · 2.17 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 hfroger/decidim:0.27-dev as bundler
COPY . /home/decidim/decidim_module_geo
RUN cd /home/decidim/app \
&& bundle config set path "vendor" \
&& bundle config set without "" \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config build.charlock_holmes --with-icu-dir=/usr/include \
# Remove spring from deps, that can have some issues with rgeo
&& echo "$(cat Gemfile | awk '!/spring/')" > Gemfile \
# Add decidim-geo gem with a local path (bounded as volume)
&& echo "gem \"decidim-decidim_geo\", path: \"../decidim_module_geo\"" >> Gemfile \
&& echo "gem \"deface\", \">= 1.8.1\"" >> Gemfile \
&& bundle
FROM hfroger/decidim:0.27-dev
ENV NODE_ENV=development \
RAILS_ENV=development \
BUNDLE_WITHOUT=""
# Add locally the current rep in module,
# This will be bound as volume later.
COPY . /home/decidim/decidim_module_geo
# Add app configuration for working in dev.
COPY ./.docker/config /home/decidim/app/config
COPY ./.docker/ecosystem.config.js /home/decidim/app/ecosystem.config.js
COPY ./.docker/ecosystem.config.js /usr/local/share/docker-entrypoint.d/ecosystem.config.js
RUN bundle config set path "vendor" \
&& bundle config set without "" \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config build.charlock_holmes --with-icu-dir=/usr/include \
&& apt-get upgrade -yq \
&& apt-get update -yq \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt install -y nodejs \
&& apt-get install -yq libgeos-dev \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /usr/local/bundle/cache \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc /usr/share/man \
&& for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done \
&& yarn add -D [email protected] \
&& cd /home/decidim/decidim_module_geo \
&& npm i \
&& npm i -g pm2
COPY --from=bundler /home/decidim/app/Gemfile /home/decidim/app/Gemfile
COPY --from=bundler /home/decidim/app/Gemfile.lock /home/decidim/app/Gemfile.lock
COPY --from=bundler /home/decidim/app/vendor /home/decidim/app/vendor
EXPOSE 3000
EXPOSE 3035
CMD ["sleep", "infinity"]