Maybe I'm using "volumes" keyword in a wrong way? I'm trying to use it to inject files into containers. For example, in Alfresco container:
volumes: - ./mysql-connector-java-8.0.25.jar:/usr/local/tomcat/lib/mysql-connector-java-8.0.25.jar - ./mysql-connector-java-8.0.25.jar:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/mysql-connector-java-8.0.25.jar - ./alfresco-global.properties:/usr/local/tomcat/shared/classes/alfresco-global.properties
I did it finally!
Several things were wrong in my setup, so it may help some unfortunate soul:
1. Your DB URI/name is not "localhost" or "127.0.0.1", but how you name it in your docker-compose file. My DB:
database: image: mysql:5.7 mem_limit: 512m ...
2. Wherever you reference DB, use that name, for example in alfresco service in docker-compose,yml file:
JAVA_OPTS ... -Ddb.url=\"jdbc:mysql://database:3306/alfresco?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=true\"
In YOUR OWN alfresco-global.properties file:
## # MySQL ## db.name=alfresco db.username=alfresco db.password=alfresco db.driver=com.mysql.cj.jdbc.Driver db.url=jdbc:mysql://database/${db.name}?useUnicode=true&characterEncoding=UTF-8 db.master.url=jdbc:mysql://database/ db.master.username=${db.username} db.master.password=${db.password} db.drop.command=drop database if exists ${db.name} db.create.command=create database ${db.name} CHARACTER SET utf8 COLLATE utf8_bin;
2. Volumes for alfresco service (watch out for writing permissions if on Linux!):
volumes: - ./volumes/data/alf_data:/usr/local/tomcat/alf_data - ./mysql-connector-java-8.0.25.jar:/usr/local/tomcat/lib/mysql-connector-java-8.0.25.jar - ./alfresco-global.properties:/usr/local/tomcat/shared/classes/alfresco-global.properties
3. My complete database service (with volumes):
database: image: mysql:5.7 mem_limit: 512m environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=alfresco - MYSQL_USER=alfresco - MYSQL_PASSWORD=alfresco command: --explicit_defaults_for_timestamp ports: - 3306:3306 security_opt: - seccomp:unconfined cap_add: - SYS_NICE # CAP_SYS_NICE volumes: - ./volumes/data/mysql_data:/var/lib/mysql - ./volumes/logs/mysql:/var/log/mysql
I'm happy, officially!
Hi @joko71
Great news - so pleased you're happy! Also, thank you for taking the time to outline how you got it working - really invaluable & may help others in a similar situation. I'll mark your thread as answered - that will also help others.
Onwards & upwards with Alfresco!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.