forked from fablabbcn/fablabs.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.24 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
FROM ruby:2.6.6
# Install essential Linux packages
RUN apt-get update -qq && apt-get install -y \
build-essential \
libpq-dev \
libqt4-dev \
libqtwebkit-dev \
libqtwebkit4 \
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
RUN gem install bundler
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle install
# Copy the Rails application into place
COPY . $APPROOT
RUN npm install
#Without yarn we cannot run rake assets:precompile'
RUN npm install yarn -g
# Precompile assets here, so we don't have to do it inside a container + restart
#RUN bin/rake assets:precompile
# Precompile started erroring 2021-01-18 - for now we precompile in scripts/deploy.sh
#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"]