Let's see how easy it is install:
git clone https://gitlab.com/hientt53/dpress.git
cp env-example .env
docker-compose up -d
That's it! enjoi :)
- Git
- Docker
>= 18
- Docker compose
- Nginx
git clone https://gitlab.com/hientt53/dpress.git
With multiple site your structure should look like this:
+ domain-A (dpress source)
+ domain-B (dpress srouce)
+ domain-C (dpress srouce)
Edit your web server sites configuration.
cp env-example .env
At the top, change the APP_NAME
variable with your folder name.
APPLICATION=domain-A
Second, change the NGINX_PORT
variable
NGINX_PORT=9000
docker-compose up -d
Now your site avariable at: http://locahost:9000
In nginx.conf change below:
example.local
to your domain name
server {
listen 80;
server_name example.local; # change this domain
...
}
...
server {
server_name www.example.local; # change this domain
return 301 $scheme://example.local$request_uri; #change this domain
}
proxy_pass http://127.0.0.1:8888;
to yourNGINX_PORT
server {
...
proxy_pass http://127.0.0.1:9000; # change this port
...
}
Link your nginx.conf
to nginx config
ln -s $PWD/nginx.conf /etc/nginx/site-enables/domain_name
Verify nginx config is correct
nginx -t
# output
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Reload nginx
sudo /etc/init.d/nginx reload
dpress build in config mysql to use mininal memory.
Setting | Default | Minimum | |
---|---|---|---|
innodb_buffer_pool_size | 128M | 5M | |
innodb_log_buffer_size | 1M | 256K | |
query_cache_size | 1M | 0 | |
max_connections | 151 | 1 | (although 10 might be more reasonable) |
key_buffer_size | 8388608 | 8 | |
thread_cache_size | (autosized | ) | 0 |
host_cache_size | (autosized | ) | 0 |
innodb_ft_cache_size | 8000000 | 1600000 | |
innodb_ft_total_cache_size | 640000000 | 32000000 | |
thread_stack | 262144 | 131072 | |
sort_buffer_size | 262144 | 32K | |
read_buffer_size | 131072 | 8200 | |
read_rnd_buffer_size | 262144 | 8200 | |
max_heap_table_size | 16777216 | 16K | |
tmp_table_size | 16777216 | 1K | |
bulk_insert_buffer_size | 8388608 | 0 | |
join_buffer_size | 262144 | 128 | |
net_buffer_length | 16384 | 1K | |
innodb_sort_buffer_size | 1M | 64K | |
binlog_cache_size | 32K | 4K | |
binlog_stmt_cache_size | 32K | 4K |