-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
47 lines (35 loc) · 1 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
FROM node:10 as client
# yeah we need sass to run 'grunt build'
RUN apt update && \
apt install -y ruby2.3 ruby2.3-dev
RUN gem install sass
WORKDIR /app
# install all JS packages
COPY ./package.json ./
COPY *bower* ./
RUN npm install
RUN npx bower install --allow-root
# try to build dist files
COPY ./.babelrc ./
COPY ./Gruntfile.js ./
RUN mkdir -p client
COPY ./client/dev ./client/dev
RUN npx grunt build
# copy eslint config for dev setup
COPY ./.eslint* ./
FROM ruby:2.6.1 as server
WORKDIR /app
COPY Gemfile* ./
RUN bundle install
# copy dist files from client
RUN mkdir -p client
COPY --from=client /app/client/dist ./client/dist
COPY --from=client /app/client/dev/lib/bootstrap/dist/css/bootstrap.min.css ./client/dist/css
COPY --from=client /app/client/dev/lib/bootstrap/dist/fonts ./client/dist/fonts
COPY ./client/data ./client/data
# copy server files
COPY ./server ./server
COPY ./config.ru ./
ENV RACK_ENV=production
ENV PORT=3000
CMD ["bash","-c","bundle exec rackup --host 0.0.0.0 -p $PORT"]