mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-08 07:22:38 +00:00
Removed frontend and updated production to use puma instead of pasenger
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
FROM ruby:2.3.0
|
||||
|
||||
|
||||
RUN apt-get clean && apt-get update
|
||||
RUN apt-get -y upgrade
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 wget apache2 apt-transport-https nodejs nodejs-legacy npm mysql-client postfix
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 wget apt-transport-https mysql-client postfix
|
||||
|
||||
#New Relic
|
||||
#RUN echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
|
||||
@@ -13,77 +12,28 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev
|
||||
#RUN apt-get install newrelic-sysmond -y
|
||||
#RUN nrsysmond-config --set license_key=$NEW_RELIC_LICENSE_KEY
|
||||
|
||||
#Passenger
|
||||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
|
||||
RUN echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main >> /etc/apt/sources.list.d/passenger.list
|
||||
RUN chown root: /etc/apt/sources.list.d/passenger.list
|
||||
RUN chmod 600 /etc/apt/sources.list.d/passenger.list
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y libapache2-mod-passenger
|
||||
|
||||
# Enable apache mods.
|
||||
RUN a2enmod rewrite
|
||||
RUN a2enmod proxy
|
||||
RUN a2enmod proxy_http
|
||||
RUN a2enmod passenger
|
||||
RUN a2enmod ssl
|
||||
|
||||
#SSL
|
||||
RUN mkdir /etc/apache2/ssl
|
||||
RUN openssl req -sha256 -subj '/CN=home/O=home LTD./C=US' -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
|
||||
|
||||
|
||||
# Manually set up the apache environment variables
|
||||
ENV APACHE_RUN_USER www-data
|
||||
ENV APACHE_RUN_GROUP www-data
|
||||
ENV APACHE_LOG_DIR /var/log/apache2
|
||||
ENV APACHE_LOCK_DIR /var/lock/apache2
|
||||
ENV APACHE_PID_FILE /var/run/apache2.pid
|
||||
RUN mkdir /ssl
|
||||
RUN openssl req -sha256 -subj '/CN=home/O=home LTD./C=US' -x509 -nodes -days 365 -newkey rsa:2048 -keyout /ssl/server.key -out /ssl/server.crt
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
|
||||
#Cache gems so they don't install on every code change
|
||||
WORKDIR /tmp
|
||||
COPY Gemfile Gemfile
|
||||
COPY Gemfile.lock Gemfile.lock
|
||||
RUN bundle install --without test
|
||||
|
||||
#Cache node_modules
|
||||
WORKDIR /tmp
|
||||
COPY frontend/package.json package.json
|
||||
RUN npm install
|
||||
RUN npm install lineman
|
||||
RUN npm install -g lineman
|
||||
|
||||
# Copy site into place.
|
||||
RUN rm -rf /var/www
|
||||
|
||||
|
||||
RUN mkdir /rails
|
||||
ENV WRESTLINGDEV_SECRET_KEY_BASE 077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2
|
||||
ENV WRESTLINGDEV_DEVISE_SECRET_KEY 2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa
|
||||
WORKDIR /var/www/
|
||||
ADD . /var/www/
|
||||
WORKDIR /rails
|
||||
ADD . /rails
|
||||
|
||||
#Copy node_modules to /var/www
|
||||
RUN mv /tmp/node_modules /var/www/frontend/node_modules
|
||||
|
||||
#RUN RAILS_ENV=production bundle exec rake db:migrate
|
||||
RUN RAILS_ENV=production bundle exec rake assets:precompile
|
||||
#RUN cp /var/www/frontend/dist/*.html /var/www/public/
|
||||
|
||||
# Update the default apache site with the config we created.
|
||||
RUN rm /etc/apache2/sites-enabled/000-default.conf
|
||||
ADD ./rails-apache-ssl-config.conf /etc/apache2/sites-available/default-ssl.conf
|
||||
ADD ./rails-apache-config.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
RUN a2ensite default-ssl.conf
|
||||
|
||||
# Add apache tuning stuff
|
||||
RUN echo PassengerMaxPoolSize 3 >> /etc/apache2/apache2.conf
|
||||
RUN echo PassengerMinInstances 3 >> /etc/apache2/apache2.conf
|
||||
RUN echo PassengerPreStart *:443 >> /etc/apache2/apache2.conf
|
||||
|
||||
|
||||
# By default, simply start apache.
|
||||
CMD /usr/sbin/apache2ctl -D FOREGROUND
|
||||
# By default, simply start puma.
|
||||
WORKDIR /rails
|
||||
CMD bundle exec puma -t 5:5 -b 'ssl://0.0.0.0:443?key=/ssl/server.key&verify_mode=none&cert=/ssl/server.crt' -e production
|
||||
|
||||
Reference in New Issue
Block a user