forked from External/greenlight
add Dockerfile and docker-compose.yml
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@ -0,0 +1,30 @@
|
||||
FROM ruby:2.5
|
||||
|
||||
# Install app dependencies.
|
||||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
|
||||
|
||||
# Set an environment variable for the install location.
|
||||
ENV RAILS_ROOT /usr/src/app
|
||||
|
||||
# Make the directory and set as working.
|
||||
RUN mkdir -p $RAILS_ROOT
|
||||
WORKDIR $RAILS_ROOT
|
||||
|
||||
# Set environment variables.
|
||||
ENV RAILS_ENV production
|
||||
|
||||
# Adding project files.
|
||||
COPY . .
|
||||
|
||||
# Install gems.
|
||||
RUN bundle install --without development test --deployment --clean
|
||||
|
||||
# Precompile assets.
|
||||
RUN bundle exec rake assets:clean
|
||||
RUN bundle exec rake assets:precompile
|
||||
|
||||
# Expose port 3000.
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application.
|
||||
CMD ["bin/start"]
|
Reference in New Issue
Block a user