Closed KeroVieux closed 5 years ago
Hello @KeroVieux, sorry for the late reply. I'll look into this issue shortly
~@KeroVieux Unfortunately, Chevereto-Free doesn't support setting the DB port out of the box. Since the free version only support MySQL Database, it expects to be able to communicate with the DB server via TCP:3306
- the default MySQL port. I'll spend some time trying to see if we can implement this into the Free Chevereto.~
~For now, I would suggest to use an HAProxy container to act as reverse proxy for your database, that way your Chevereto container can communicate with the DB on port TCP:3306
~
Sorry for the incorrect information earlier.
We have new releases of the image that support the environment variable CHEVERETO_DB_PORT
now 🎉
I tested it by placing the following 2 files into the same directory and run docker-compose up
, then open localhost:8080
on my browser. Note that in this example Chevereto is connecting to database server via TCP:3309
instead of the default TCP:3306
my.cnf
:
# MariaDB database server configuration file.
#
# You can copy this file to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[client] port = 3309 socket = /var/run/mysqld/mysqld.sock
[mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0
[mysqld] #
#
pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3309 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking #
#
# max_connections = 100 connect_timeout = 5 wait_timeout = 600 max_allowed_packet = 16M thread_cache_size = 128 sort_buffer_size = 4M bulk_insert_buffer_size = 16M tmp_table_size = 32M max_heap_table_size = 32M #
#
myisam_recover_options = BACKUP key_buffer_size = 128M
table_open_cache = 400 myisam_sort_buffer_size = 512M concurrent_insert = 2 read_buffer_size = 2M read_rnd_buffer_size = 1M #
#
query_cache_limit = 128K query_cache_size = 64M
#
#
#
#
#
slow_query_log_file = /var/log/mysql/mariadb-slow.log long_query_time = 10
#
expire_logs_days = 10 max_binlog_size = 100M
#
#
#
default_storage_engine = InnoDB
innodb_buffer_pool_size = 256M innodb_log_buffer_size = 8M innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 400 innodb_flush_method = O_DIRECT #
#
#
#
#
# [galera]
#
#
#
[mysqldump] quick quote-names max_allowed_packet = 16M
[mysql]
[isamchk] key_buffer = 16M
#
# !include /etc/mysql/mariadb.cnf !includedir /etc/mysql/conf.d/
* `docker-compose.yaml`
```yaml
version: '3'
networks:
private:
services:
db:
image: mariadb
volumes:
- ./my.cnf:/etc/mysql/my.cnf:ro
networks:
- private
environment:
MYSQL_ROOT_PASSWORD: chevereto_root
MYSQL_DATABASE: chevereto
MYSQL_USER: chevereto
MYSQL_PASSWORD: chevereto
chevereto:
image: nmtan/chevereto
restart: always
networks:
- private
environment:
CHEVERETO_DB_HOST: db
CHEVERETO_DB_USERNAME: chevereto
CHEVERETO_DB_PASSWORD: chevereto
CHEVERETO_DB_NAME: chevereto
CHEVERETO_DB_PREFIX: chv_
CHEVERETO_DB_PORT: '3309'
ports:
- 8080:80
I have a MySQL exist, so I'd like to use that, no need setup one more DB with it, how could I deal with it, there is no param named CHEVERETO_DB_PORT ?