mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 04:21:36 +00:00
Fix docker image
Fix bunch of things with docker and add entry.sh
This commit is contained in:
parent
4a8bd8ee7d
commit
3984ad2442
7 changed files with 29 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
/log/*
|
||||
/tmp/*
|
||||
/spec/tmp/*
|
||||
/env/*
|
||||
.ruby-version
|
||||
.ruby-gemset
|
||||
.env
|
||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -29,10 +29,15 @@ USER web
|
|||
|
||||
WORKDIR /var/www
|
||||
COPY .env /var/www/
|
||||
RUN bundle install --path /var/bundle
|
||||
RUN bundle exec rake assets:precompile
|
||||
RUN bundle install --path /var/bundle --jobs 4
|
||||
#RUN bundle exec rake assets:precompile
|
||||
|
||||
# When using bash
|
||||
USER root
|
||||
|
||||
CMD ["bundle", "exec", "puma", "-C /var/www/config/puma.rb"]
|
||||
RUN apt-get install -y memcached
|
||||
RUN service memcached start
|
||||
|
||||
#USER root
|
||||
|
||||
USER web
|
||||
CMD ["/var/www/entry.sh"]
|
||||
|
|
|
@ -10,6 +10,7 @@ module Ensl
|
|||
|
||||
# Additional assets
|
||||
config.assets.precompile += ["themes/*/theme.css", "themes/*/errors.css"]
|
||||
config.assets.initialize_on_precompile = false
|
||||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
config.autoload_paths += Dir["#{config.root}/app/services/**/", "#{config.root}/app/models/concerns/"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
base: &db
|
||||
adapter: mysql2
|
||||
encoding: utf8
|
||||
host: <%= ENV['MYSQL_HOST'] || 'localhost' %>
|
||||
host: <%= ENV['MYSQL_HOST'] %>
|
||||
database: <%= ENV['MYSQL_DATABASE'] %>
|
||||
username: <%= ENV['MYSQL_USERNAME'] %>
|
||||
password: <%= ENV['MYSQL_PASSWORD'] %>
|
||||
|
|
|
@ -64,4 +64,7 @@ Ensl::Application.configure do
|
|||
|
||||
# Custom Session Store config to allow gathers.staging.ensl.org
|
||||
config.session_store :cookie_store, key: "_ENSL_session_key", expire_after: 30.days.to_i, domain: ".ensl.org"
|
||||
|
||||
# config.cache_store = :dalli_store, 'cache', 'cache-2.example.com:11211:2',
|
||||
# { :namespace => NAME_OF_RAILS_APP, :expires_in => 1.day, :compress => true }
|
||||
end
|
6
entry.sh
Executable file
6
entry.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
env|grep -i MYSQL
|
||||
cd /var/www
|
||||
bundle exec rake assets:precompile
|
||||
bundle exec puma -C config/puma.rb
|
12
fig.yml
12
fig.yml
|
@ -1,9 +1,11 @@
|
|||
web:
|
||||
image: ensl/ensl.org
|
||||
image: ensl
|
||||
links:
|
||||
- mysql
|
||||
- redis
|
||||
# - redis
|
||||
mysql:
|
||||
image: mysql
|
||||
redis:
|
||||
image: redis
|
||||
image: mysql/mysql-server
|
||||
volumes:
|
||||
- /srv/ensl/mysql:/var/lib/mysql
|
||||
#redis:
|
||||
# image: redis
|
||||
|
|
Loading…
Reference in a new issue