forked from loomio/loomio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.31 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
#
# Warning: this image is designed to be used with docker-compose as
# instructed athttps://github.com/loomio/loomio-deploy
#
# It is not a standalone image.
#
FROM ruby:2.3.0
ENV REFRESHED_AT 2015-08-07
RUN apt-get update -qq && apt-get install -y build-essential sudo apt-utils
# for postgres
RUN apt-get install -y libpq-dev
# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev
# for node
# RUN apt-get install -y python python-dev python-pip python-virtualenv
# install node
RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
RUN apt-get install -y nodejs
# RUN mkdir /loomio
WORKDIR /loomio
ADD . /loomio
COPY config/database.docker.yml /loomio/config/database.yml
WORKDIR /loomio/angular
RUN npm install -g yarn
RUN npm install
RUN npm rebuild node-sass
WORKDIR /loomio
RUN bundle install
# use development env to build assets with fake sqlite database (heroku blocks you from using sqlite in production)
ENV RAILS_ENV development
# fake config for building assets (yawn)
ENV DATABASE_URL sqlite3:assets_throwaway.db
ENV DEVISE_SECRET boopboop
ENV SECRET_COOKIE_TOKEN beepbeep
# build assets
RUN bundle exec rake deploy:build[plugins.docker]
RUN bundle exec rake assets:precompile
EXPOSE 3000
# source the config file and run puma when the container starts
CMD bundle exec puma -C config/puma.rb