mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-03 06:51:04 +00:00
Update docker version
With docker-compose and mariadb
This commit is contained in:
parent
3989846235
commit
6b2f644352
10 changed files with 80 additions and 27 deletions
|
@ -1 +1,2 @@
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
db_data
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -14,6 +14,10 @@
|
||||||
*.rbc
|
*.rbc
|
||||||
*.sassc
|
*.sassc
|
||||||
|
|
||||||
|
# Database and files
|
||||||
|
db_data/*
|
||||||
|
!db_data/.placeholder
|
||||||
|
|
||||||
# OS X
|
# OS X
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,12 @@ ADD . /var/www
|
||||||
RUN chown -R web:web /var/www
|
RUN chown -R web:web /var/www
|
||||||
|
|
||||||
# Precompile assets
|
# Precompile assets
|
||||||
#WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
#RUN bundle exec rake assets:precompile
|
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
|
||||||
|
|
||||||
# for debug
|
# for debug
|
||||||
# USER root
|
# USER root
|
||||||
|
|
||||||
USER web
|
|
||||||
CMD ["/var/www/entry.sh"]
|
CMD ["/var/www/entry.sh"]
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -1,5 +1,6 @@
|
||||||
PROJECT ?= ensl/ensl.org
|
REGISTRY ?= ensl
|
||||||
TAG ?= latest
|
PROJECT ?= ensl.org
|
||||||
|
TAG ?= latest
|
||||||
|
|
||||||
ifdef REGISTRY
|
ifdef REGISTRY
|
||||||
IMAGE=$(REGISTRY)/$(PROJECT):$(TAG)
|
IMAGE=$(REGISTRY)/$(PROJECT):$(TAG)
|
||||||
|
|
29
docker-compose.yml
Normal file
29
docker-compose.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: ensl/ensl.org:latest
|
||||||
|
# volumes:
|
||||||
|
# - "/srv/ensl/ensl.org/public:/var/www/public"
|
||||||
|
ports:
|
||||||
|
- "4000:4000"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- memcached
|
||||||
|
# - redis
|
||||||
|
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"
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE
|
||||||
|
- MYSQL_USER
|
||||||
|
- MYSQL_USERNAME
|
||||||
|
- MYSQL_PASSWORD
|
||||||
|
- MYSQL_ROOT_PASSWORD
|
||||||
|
# - MYSQL_ROOT_HOST
|
||||||
|
memcached:
|
||||||
|
image: memcached:latest
|
||||||
|
#redis:
|
||||||
|
# image: redis
|
7
entry.sh
7
entry.sh
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
env
|
|
||||||
cd /var/www
|
|
||||||
source .env
|
|
||||||
bundle exec rake assets:precompile
|
|
||||||
bundle exec puma -C config/puma.rb
|
|
31
ext/mysql.conf.d/opt.cnf
Normal file
31
ext/mysql.conf.d/opt.cnf
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
[mysqld]
|
||||||
|
|
||||||
|
skip-host-cache
|
||||||
|
skip-name-resolve
|
||||||
|
|
||||||
|
key_buffer = 150M
|
||||||
|
max_allowed_packet = 20M
|
||||||
|
thread_stack = 196K
|
||||||
|
thread_cache_size = 16
|
||||||
|
|
||||||
|
max_connections = 96
|
||||||
|
table_cache = 2000
|
||||||
|
table_definition_cache = 800
|
||||||
|
thread_concurrency = 128
|
||||||
|
|
||||||
|
query_cache_limit = 30M
|
||||||
|
query_cache_size = 150M
|
||||||
|
open_files_limit = 1800
|
||||||
|
join_buffer_size = 1M
|
||||||
|
sort_buffer_size = 1M
|
||||||
|
read_buffer_size = 128K
|
||||||
|
tmp_table_size = 500M
|
||||||
|
max_heap_table_size = 500M
|
||||||
|
|
||||||
|
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_file_per_table = 1
|
||||||
|
transaction-isolation = READ-COMMITTED
|
15
fig.yml
15
fig.yml
|
@ -1,15 +0,0 @@
|
||||||
web:
|
|
||||||
image: ensl
|
|
||||||
volumes:
|
|
||||||
- "/srv/ensl/public:/var/www/public"
|
|
||||||
ports:
|
|
||||||
- "4000:4000"
|
|
||||||
links:
|
|
||||||
- mysql
|
|
||||||
# - redis
|
|
||||||
mysql:
|
|
||||||
image: mysql/mysql-server:5.7
|
|
||||||
volumes:
|
|
||||||
- "/srv/ensl/mysql:/var/lib/mysql"
|
|
||||||
#redis:
|
|
||||||
# image: redis
|
|
8
script/entry.sh
Executable file
8
script/entry.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in a new issue