Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #2627

Merged
merged 4 commits into from
Apr 30, 2019
Merged

Develop #2627

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM ruby:2.5.5
# - build-essential: To ensure certain gems can be compiled
# - nodejs: Compile assets
RUN set -x; \
apt-get update \
&& apt-get install -y --no-install-recommends \
apt update \
&& apt install -y --no-install-recommends \
openssh-server \
zlib1g-dev \
build-essential \
Expand All @@ -22,12 +22,13 @@ RUN set -x; \
libmagickwand-dev

# Set an environment variable where the Rails app is installed to inside of Docker image
ENV RAILS_ROOT /var/www/cenit
ENV DIR_ROOT /var/www
ENV RAILS_ROOT $DIR_ROOT/cenit
RUN mkdir -p $RAILS_ROOT

RUN mkdir -p /var/www/shared/log
RUN mkdir -p /var/www/shared/pids
RUN mkdir -p /var/www/shared/sockets
RUN mkdir -p $DIR_ROOT/shared/log
RUN mkdir -p $DIR_ROOT/shared/pids
RUN mkdir -p $DIR_ROOT/shared/sockets

# Set working directory
WORKDIR $RAILS_ROOT
Expand All @@ -45,9 +46,11 @@ RUN bundle install --jobs 20 --retry 5 --without development test
# Adding project files
COPY . .

ENV SKIP_MONGO_CLIENT='true'

RUN set -x; \
SKIP_MONGO_CLIENT='true' bundle exec rake assets:precompile
bundle exec rake assets:precompile

EXPOSE 8080

CMD bundle exec unicorn -c config/unicorn.rb
CMD ["bundle", "exec", "unicorn", "-c", "config/unicorn.rb"]
2 changes: 1 addition & 1 deletion config/mongoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ production:
default:
database: <%= ENV['DB_PROD'] || 'cenit_prod' %>
hosts:
- localhost:27017
- <%= ENV['DB_PORT'] || 'localhost:27017' %>
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ services:
- RABBITMQ_BIGWIG_TX_URL=amqp://cenit_rabbit:cenit_rabbit@rabbitmq/cenit_rabbit_vhost
- UNICORN_WORKERS=5
- MAXIMUM_UNICORN_CONSUMERS=3
- SKIP_MONGO_CLIENT='false'
build: .
command: bundle exec unicorn_rails -E production -c config/unicorn.rb
ports:
- "8080:8080"
depends_on:
- mongodb
- rabbitmq

rabbitmq:
image: rabbitmq
image: rabbitmq:management
ports:
- "15672:15672"
- "5672:5672"
Expand Down