Update to a working version

- Use assets workaround to work around the volume issue with docker
- Add assets to gitignore
- Fix dalli hostname
- Update docker-compose to new paths for volumes
- Fix MariaDB issue with optimization opts
This commit is contained in:
Ari Timonen 2018-04-25 16:41:22 +00:00
parent 5096be9ff3
commit 22fc8cb50b
6 changed files with 18 additions and 13 deletions

1
.gitignore vendored
View file

@ -26,6 +26,7 @@ db_data/*
/public/files/*
/public/local
/public/uploads
/public/assets
# RubyMine
/.idea

View file

@ -23,13 +23,14 @@ RUN su -c "bundle config github.https true; cd /var/www && bundle install --path
ADD . /var/www
RUN chown -R web:web /var/www
# Precompile assets
WORKDIR /var/www
USER web
RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4
RUN bundle exec rake assets:precompile && mv /var/www/public/assets /var/www/assets_tmp
RUN bundle exec rake assets:precompile
# for debug
# USER root
# This is a temporary solution to fix assets issue
RUN mv /var/www/public/assets /home/web/assets
CMD ["/var/www/scripts/entry.sh"]
USER root
CMD ["/var/www/script/entry.sh"]

View file

@ -37,7 +37,7 @@ Ensl::Application.configure do
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :dalli_store
config.cache_store = :dalli_store, 'memcached:11211', 'localhost'
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View file

@ -3,8 +3,8 @@ version: "3"
services:
web:
image: ensl/ensl.org:latest
# volumes:
# - "/srv/ensl/ensl.org/public:/var/www/public"
volumes:
- "./public:/var/www/public"
ports:
- "4000:4000"
depends_on:
@ -14,8 +14,8 @@ services:
db:
image: mariadb:latest
volumes:
- "/srv/ensl/ensl.org/db_data:/var/lib/mysql"
# - "/srv/ensl/ensl.org/ext/mysql.conf.d:/etc/mysql/conf.d"
- "./db_data:/var/lib/mysql"
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
environment:
- MYSQL_DATABASE
- MYSQL_USER

View file

@ -26,6 +26,6 @@ innodb_buffer_pool_size = 1280M
innodb_flush_log_at_trx_commit = 1
innodb_thread_concurrency = 16
innodb_flush_method = O_DIRECT
innodb_additional_mem_pool_size = 20M
#innodb_additional_mem_pool_size = 20M
innodb_file_per_table = 1
transaction-isolation = READ-COMMITTED

View file

@ -4,5 +4,8 @@ env
cd /var/www
source /var/www/.env
rm -rf /var/www/public/assets
mv /var/www/assets_tmp /var/www/public/
bundle exec puma -C config/puma.rb
mv /home/web/assets /var/www/public/
chown -R web:web /var/www/public
#bundle exec rake assets:precompile
su -c "cd /var/www && bundle exec puma -C config/puma.rb" -s /bin/bash -l web