-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (19 loc) · 999 Bytes
/
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
FROM ruby:2.4
#Create the directory from which the production code will be hosted
ENV APP_DIR=/usr/
# Set the rails environment early on, so that all processes are done with production settings
ENV RAILS_ENV=production
# Install the basic dependencies for building rails-based applications
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y tzdata libmysqlclient-dev nodejs curl git
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR
# Install rails. If you change this version, specify so in the Gemfile as well.
RUN gem install rails --no-rdoc --no-ri
# Now copy the Gemfile into the container so that we have the correct gem configuration
COPY . ./
RUN bundle install --without development test -j4
# Finally, precompile the asset pipeline
RUN bundle exec rake assets:precompile
# Publish port 8080, because that's the port that nginx-proxy looks for. Be sure this is configured in your config/puma.rb file if you're recreating this repo.
EXPOSE 8080