mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-09 09:41:00 +00:00
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:
parent
5096be9ff3
commit
22fc8cb50b
6 changed files with 18 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -26,6 +26,7 @@ db_data/*
|
||||||
/public/files/*
|
/public/files/*
|
||||||
/public/local
|
/public/local
|
||||||
/public/uploads
|
/public/uploads
|
||||||
|
/public/assets
|
||||||
|
|
||||||
# RubyMine
|
# RubyMine
|
||||||
/.idea
|
/.idea
|
||||||
|
|
11
Dockerfile
11
Dockerfile
|
@ -23,13 +23,14 @@ RUN su -c "bundle config github.https true; cd /var/www && bundle install --path
|
||||||
ADD . /var/www
|
ADD . /var/www
|
||||||
RUN chown -R web:web /var/www
|
RUN chown -R web:web /var/www
|
||||||
|
|
||||||
# Precompile assets
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
USER web
|
USER web
|
||||||
|
|
||||||
RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4
|
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
|
# This is a temporary solution to fix assets issue
|
||||||
# USER root
|
RUN mv /var/www/public/assets /home/web/assets
|
||||||
|
|
||||||
CMD ["/var/www/scripts/entry.sh"]
|
USER root
|
||||||
|
CMD ["/var/www/script/entry.sh"]
|
||||||
|
|
|
@ -37,7 +37,7 @@ Ensl::Application.configure do
|
||||||
# config.logger = SyslogLogger.new
|
# config.logger = SyslogLogger.new
|
||||||
|
|
||||||
# Use a different cache store in production
|
# 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
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||||
# config.action_controller.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = "http://assets.example.com"
|
||||||
|
|
|
@ -3,8 +3,8 @@ version: "3"
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
image: ensl/ensl.org:latest
|
image: ensl/ensl.org:latest
|
||||||
# volumes:
|
volumes:
|
||||||
# - "/srv/ensl/ensl.org/public:/var/www/public"
|
- "./public:/var/www/public"
|
||||||
ports:
|
ports:
|
||||||
- "4000:4000"
|
- "4000:4000"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -14,8 +14,8 @@ services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:latest
|
image: mariadb:latest
|
||||||
volumes:
|
volumes:
|
||||||
- "/srv/ensl/ensl.org/db_data:/var/lib/mysql"
|
- "./db_data:/var/lib/mysql"
|
||||||
# - "/srv/ensl/ensl.org/ext/mysql.conf.d:/etc/mysql/conf.d"
|
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE
|
- MYSQL_DATABASE
|
||||||
- MYSQL_USER
|
- MYSQL_USER
|
||||||
|
|
|
@ -26,6 +26,6 @@ innodb_buffer_pool_size = 1280M
|
||||||
innodb_flush_log_at_trx_commit = 1
|
innodb_flush_log_at_trx_commit = 1
|
||||||
innodb_thread_concurrency = 16
|
innodb_thread_concurrency = 16
|
||||||
innodb_flush_method = O_DIRECT
|
innodb_flush_method = O_DIRECT
|
||||||
innodb_additional_mem_pool_size = 20M
|
#innodb_additional_mem_pool_size = 20M
|
||||||
innodb_file_per_table = 1
|
innodb_file_per_table = 1
|
||||||
transaction-isolation = READ-COMMITTED
|
transaction-isolation = READ-COMMITTED
|
||||||
|
|
|
@ -4,5 +4,8 @@ env
|
||||||
cd /var/www
|
cd /var/www
|
||||||
source /var/www/.env
|
source /var/www/.env
|
||||||
rm -rf /var/www/public/assets
|
rm -rf /var/www/public/assets
|
||||||
mv /var/www/assets_tmp /var/www/public/
|
mv /home/web/assets /var/www/public/
|
||||||
bundle exec puma -C config/puma.rb
|
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
|
||||||
|
|
Loading…
Reference in a new issue