parsley/Dockerfile

39 lines
1.0 KiB
Docker
Raw Normal View History

2016-01-18 20:50:19 -06:00
FROM phusion/passenger-ruby22:latest
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# Enable Nginx / Passenger
RUN rm -f /etc/service/nginx/down
# Install nginx config files
RUN rm /etc/nginx/sites-enabled/default
ADD docker/nginx_server.conf /etc/nginx/sites-enabled/parsley.conf
ADD docker/nginx_env.conf /etc/nginx/main.d/env.conf
# Set Default RAILS_ENV
ENV PASSENGER_APP_ENV docker
# Setup directory and install gems
RUN mkdir -p /home/app/parsley/
COPY Gemfile /home/app/parsley/
COPY Gemfile.lock /home/app/parsley/
RUN cd /home/app/parsley/ && bundle install --deployment
# Copy the app into the image
COPY . /home/app/parsley/
WORKDIR /home/app/parsley/
# Set log permissions
RUN mkdir -p /home/app/parsley/log
RUN chmod 0777 /home/app/parsley/log
# Compile assets
RUN env RAILS_ENV=production bundle exec rake assets:clobber assets:precompile
# Set ownership of the tmp folder
RUN chown -R app:app /home/app/parsley/tmp
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*