forked from openware/peatio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (44 loc) · 1.49 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
56
FROM ruby:2.5.0
MAINTAINER [email protected]
# By default image is built using RAILS_ENV=production.
# You may want to customize it:
#
# --build-arg RAILS_ENV=development
#
# See https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables-build-arg
#
ARG RAILS_ENV=production
ENV RAILS_ENV ${RAILS_ENV}
ENV APP_HOME=/home/app
RUN groupadd -r app --gid=1000
RUN useradd -r -m -g app -d /home/app --uid=1000 app
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y \
default-libmysqlclient-dev \
imagemagick \
gsfonts \
chromedriver \
nodejs \
yarn
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
RUN bundle exec rake tmp:create yarn:install assets:precompile
# 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 ["puma", "--config", "config/puma.rb"]