This repository has been archived by the owner on Aug 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (44 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
53
54
55
FROM ruby:2.6.0-slim
MAINTAINER Florian Dejonckheere <florian@floriandejonckheere.be>
##
# Create user and group
#
RUN useradd openwebslides --create-home --home-dir /app/ --shell /bin/false
##
# Install package dependencies
#
RUN apt-get update && apt-get install -qq -y --no-install-recommends \
curl gnupg
# Node
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
# Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list
# Install packages
RUN apt-get update && apt-get install -qq -y --no-install-recommends \
build-essential nodejs libpq-dev libsqlite3-dev cmake pkg-config git yarn libfontconfig1
WORKDIR /app/
ENV RAILS_ENV production
##
# Install Ruby dependencies
#
COPY Gemfile Gemfile.lock /app/
RUN gem install bundler
RUN bundle install --deployment --without development test
##
# Install Node dependencies
#
COPY web/package.json web/yarn.lock /app/web/
RUN cd /app/web && yarn install
##
# Add application
#
COPY . /app/
##
# Build public assets
#
RUN cd /app/web && rm -rf dist/ && ./node_modules/.bin/webpack --config webpack.config.js --mode production
##
# Run application
#
CMD /app/docker-entrypoint.sh