forked from fablabbcn/fablabs.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (37 loc) · 1.11 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
FROM ruby:2.5.3-stretch
# Install essential Linux packages
RUN apt-get update -qq && apt-get install -y \
build-essential \
libpq-dev \
libqt4-dev \
libqtwebkit-dev \
postgresql-client \
imagemagick \
curl
# Install NodeJS 10
RUN curl -sL https://deb.nodesource.com/setup_10.x > setup_10.x
RUN chmod +x setup_10.x
RUN ./setup_10.x
RUN apt install nodejs
RUN /usr/bin/nodejs -v
RUN npm -v
ENV APPROOT /fablabs
WORKDIR /$APPROOT
# Create application home. App server will need the pids dir so just create everything in one shot
RUN mkdir -p $APPROOT/tmp/pids
# Update Gems
#RUN gem update --system
# Bundler
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES 1
RUN gem install bundler
ADD Gemfile Gemfile
ADD Gemfile.lock Gemfile.lock
RUN bundle install
# Copy the Rails application into place
COPY . $APPROOT
RUN npm install
# Precompile assets here, so we don't have to do it inside a container + restart
RUN bin/rake assets:precompile
#CMD ["rails", "server", "-b", "0.0.0.0"]
#CMD ["bash","-c","rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"]
CMD ["bash","-c","bundle exec puma -C config/puma.rb"]