forked from openware/peatio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (33 loc) · 1.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
FROM ruby:2.4.2
MAINTAINER [email protected]
ENV APP_HOME=/home/app
RUN groupadd -r app --gid=1000
RUN useradd -r -m -g app -d /home/app --uid=1000 app
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y \
nodejs \
libmysqlclient-dev \
imagemagick \
gsfonts \
chromedriver
WORKDIR $APP_HOME
COPY Gemfile Gemfile.lock $APP_HOME/
# Install dependencies
RUN mkdir -p /opt/vendor/bundle && chown -R app:app /opt/vendor
RUN su app -s /bin/bash -c "bundle install --path /opt/vendor/bundle"
# Copy the main application.
COPY . $APP_HOME
RUN chown -R app:app /home/app
USER app
RUN ./bin/init_config
# Expose port 8080 to the Docker host, so we can access it
# from the outside.
EXPOSE 8080
ENTRYPOINT ["bundle", "exec"]
# The main command to run when the container starts. Also
# tell the Rails dev server to bind to all interfaces by
# default.
CMD ["rails", "s", "-p", "8080", "-b", "0.0.0.0"]