-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
51 lines (39 loc) · 1.46 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
FROM ruby:2.7.8-bullseye
# Install essential Linux packages
RUN apt-get update -qq && apt-get install -y \
build-essential \
libpq-dev \
libqt5webkit5-dev \
postgresql-client \
imagemagick \
curl
# Install NodeJS
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& /usr/bin/node -v \
&& 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
COPY Gemfile Gemfile.lock .ruby-version $APPROOT/
ENV BUNDLER_VERSION=2.4.20
RUN gem install bundler -v 2.4.20
RUN bundle install
#Without yarn we cannot run rake assets:precompile'
RUN npm install yarn -g
COPY package.json yarn.lock $APPROOT/
RUN yarn install
# Copy the Rails application into place
COPY . $APPROOT
# 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
# Add a script to be executed every time the container starts.
# TODO: use the entryscript to WAIT for the other containers, so the app survives restart?
# Right now we have to start containers in correct order and wait for services to be ready
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD [ "bin/rails", "server", "-p", "3000", "-b", "0.0.0.0" ]