Created
December 8, 2017 08:35
-
-
Save koeckc/8ed92bab8be9156eee1e07c55b3ab30f to your computer and use it in GitHub Desktop.
Dockerfile ruby meeting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Use the barebones version of Ruby 2.2.3. | |
FROM ruby:2.3.5-slim | |
# Optionally set a maintainer name to let people know who made this image. | |
MAINTAINER C.Köck <[email protected]> | |
# Install dependencies: | |
RUN apt-get update && apt-get install -qq -y build-essential git-core apt-transport-https --fix-missing --no-install-recommends | |
RUN apt-get install -qq -y ghostscript imagemagick libmagickcore-dev libmagickwand-dev postgresql-client libpq-dev libgsf-1-dev libmagic1 file curl --fix-missing --no-install-recommends | |
# Install libvips | |
WORKDIR /root | |
RUN curl -LJO https://github.com/jcupitt/libvips/releases/download/v8.5.9/vips-8.5.9.tar.gz | |
RUN tar xvf vips-8.5.9.tar.gz | |
WORKDIR /root/vips-8.5.9 | |
RUN ./configure | |
RUN make | |
RUN make install | |
RUN echo "/usr/local/lib/" >> /etc/ld.so.conf.d/local.conf | |
RUN apt-get install libvips -qq -y | |
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | |
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | |
RUN apt-get update && apt-get install nodejs yarn -qq -y | |
# Set an environment variable to store where the app is installed to inside | |
# of the Docker image. | |
ENV INSTALL_PATH /defectradar | |
RUN mkdir -p $INSTALL_PATH | |
# This sets the context of where commands will be ran in and is documented | |
# on Docker's website extensively. | |
ADD Gemfile $INSTALL_PATH/ | |
ADD Gemfile.lock $INSTALL_PATH/ | |
WORKDIR $INSTALL_PATH | |
RUN rm -rf /root/vips-8.5.9 | |
RUN RAILS_ENV=development gem install bundler && bundle install --jobs 20 --retry 5 | |
# --- Add this to your Dockerfile --- | |
ENV RAILS_ENV development | |
COPY . ./ | |
RUN yarn | |
RUN RAILS_ENV=development bundle exec spring binstub --all | |
#RUN chmod a+rwx -R project-dir/system | |
#RUN chmod a+rwx -R project-dir/system | |
EXPOSE 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment