Skip to content

Commit

Permalink
Move back to unicorn from passenger
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Clark authored and Michael O'Keefe committed Jul 10, 2017
1 parent c34cade commit cbaab21
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 26 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Expand Up @@ -5,6 +5,11 @@ RUN apt-get update \
&& apt-get install -y nodejs tzdata \
&& rm -rf /var/lib/apt/lists/*

# Install ruby 2.3.4 in order to match what we are developing against.
RUN bash -lc 'rvm install ruby-2.3.4'
RUN bash -lc 'rvm --default use ruby-2.3.4'
RUN gem install bundler

ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES 1

Expand All @@ -29,11 +34,9 @@ RUN mkdir -p tmp
# we are able to do the bundle install earlier on which means it is cached more often.
RUN chown -R app:app .

RUN rm -f /etc/service/nginx/down

RUN rm /etc/nginx/sites-enabled/default
ADD docker-nginx.conf /etc/nginx/sites-enabled/cypress.conf
ADD docker-nginx-env.conf /etc/nginx/main.d/nginx-env.conf
RUN mkdir /etc/service/unicorn
ADD docker_unicorn_start.sh /etc/service/unicorn/run
RUN chmod 755 /etc/service/unicorn/run

RUN mkdir /etc/service/cypress_delayed_job_1
ADD docker_delayed_job.sh /etc/service/cypress_delayed_job_1/run
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Expand Up @@ -14,9 +14,7 @@ services:
env_file: .env-prod
restart: unless-stopped
mongodb:
image: mongo
image: mongo:3.4.5
volumes:
- /data/db
ports:
- "27017:27017"
restart: unless-stopped
4 changes: 0 additions & 4 deletions docker-nginx-env.conf

This file was deleted.

13 changes: 0 additions & 13 deletions docker-nginx.conf

This file was deleted.

2 changes: 1 addition & 1 deletion docker_delayed_job.sh
Expand Up @@ -7,5 +7,5 @@ PID_FULL_PATH="$PID_FOLDER/$PID_NAME"
cd /home/app/cypress
mkdir -p $PID_FOLDER
touch $PID_FULL_PATH
exec /sbin/setuser app bundle exec rake jobs:work >>log/$PROCESS_NAME.log 2>&1
exec /sbin/setuser app bundle exec rake jobs:work >> log/$PROCESS_NAME.log 2>&1
rm $PID_FULL_PATH
5 changes: 5 additions & 0 deletions docker_unicorn_start.sh
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

cd /home/app/cypress
exec /sbin/setuser app bundle exec unicorn -c config/unicorn.rb -p 3000 >>log/unicorn.log 2>&1

0 comments on commit cbaab21

Please sign in to comment.