forked from OpenSourcePolitics/decidim-nyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1015 Bytes
/
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
FROM ruby:2.7.1
# Install NodeJS
RUN curl https://deb.nodesource.com/setup_16.x | bash
RUN apt install -y nodejs
# Install Yarn
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt install -y yarn
# Decidim dependencies
RUN apt install -y libicu-dev postgresql-client
# Install npm
RUN npm install -g [email protected]
# Install bundler
RUN gem install bundler:2.2.29
# Copy all decidim-app content to /app
ADD . /app
WORKDIR /app
RUN bundle install && yarn install && bundle exec rails assets:precompile
# Perform assets compilation
RUN yarn install
RUN SECRET_KEY_BASE=dummy bundle exec rails assets:precompile
# Configure endpoint.
COPY ./entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]