parsley/Dockerfile

43 lines
1.2 KiB
Docker
Raw Normal View History

2020-05-02 14:12:04 -05:00
FROM ruby:2.7.1-buster
2016-07-07 17:47:47 -05:00
2020-01-18 18:07:07 -06:00
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
2018-03-30 14:31:09 -05:00
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
2020-05-02 14:12:04 -05:00
apt-get update && apt-get dist-upgrade -y && \
apt-get install -y \
nodejs \
yarn \
nginx && \
2020-01-18 18:07:07 -06:00
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
2018-03-30 14:31:09 -05:00
RUN gem update --system && gem install bundler
2016-01-18 20:50:19 -06:00
# Install nginx config files
RUN rm /etc/nginx/sites-enabled/default
ADD docker/nginx_server.conf /etc/nginx/sites-enabled/parsley.conf
2020-05-02 14:12:04 -05:00
# Add scripts
ADD docker/bin/* /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/nginx_service.sh /usr/local/bin/rails_service.sh
2016-01-19 17:26:23 -06:00
2016-01-18 20:50:19 -06:00
# Set Default RAILS_ENV
ENV RAILS_ENV docker
2016-01-18 20:50:19 -06:00
# Setup directory and install gems
2020-05-02 14:12:04 -05:00
RUN mkdir -p /parsley
WORKDIR /parsley
2016-01-18 20:50:19 -06:00
2018-03-30 14:31:09 -05:00
COPY Gemfile* ./
2020-05-02 14:12:04 -05:00
RUN bundle install
2018-03-30 14:31:09 -05:00
COPY package.json yarn.lock ./
2020-05-02 14:12:04 -05:00
RUN yarn install --production=true --frozen-lockfile
2018-03-30 14:31:09 -05:00
2020-05-02 14:12:04 -05:00
COPY . .
2016-01-18 20:50:19 -06:00
# Compile assets
2020-05-02 14:12:04 -05:00
RUN bundle exec rails webpacker:clobber webpacker:compile
2016-01-18 20:50:19 -06:00
2020-05-02 14:12:04 -05:00
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]