{"id":15653082,"url":"https://github.com/mdelapenya/docker-tomcat-mysql","last_synced_at":"2025-04-30T17:11:18.466Z","repository":{"id":141609842,"uuid":"88032618","full_name":"mdelapenya/docker-tomcat-mysql","owner":"mdelapenya","description":"Docker image for tomcat+mysql, orchestrated with supervisord","archived":false,"fork":false,"pushed_at":"2020-06-21T15:23:20.000Z","size":12,"stargazers_count":30,"open_issues_count":0,"forks_count":46,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T07:46:55.784Z","etag":null,"topics":["docker","mysql","supervisord","tomcat"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdelapenya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-12T09:12:12.000Z","updated_at":"2024-04-21T16:05:54.000Z","dependencies_parsed_at":"2023-04-11T06:08:57.964Z","dependency_job_id":null,"html_url":"https://github.com/mdelapenya/docker-tomcat-mysql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fdocker-tomcat-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fdocker-tomcat-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fdocker-tomcat-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fdocker-tomcat-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdelapenya","download_url":"https://codeload.github.com/mdelapenya/docker-tomcat-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748950,"owners_count":21637418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","mysql","supervisord","tomcat"],"created_at":"2024-10-03T12:44:38.870Z","updated_at":"2025-04-30T17:11:18.440Z","avatar_url":"https://github.com/mdelapenya.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\nTo create the image `mdelapenya/tomcat-mysql`, execute the following command on the mdelapenya-docker-tomcat-mysql folder:\n\n```shell\ndocker build -t mdelapenya/tomcat-mysql .\n```\n\nYou can now push your new image to the registry:\n\n```shell\ndocker push mdelapenya/tomcat-mysql\n```\n\n## Running your tomcat-mysql docker image\n\nStart your image binding the external ports 8080 and 3306 in all interfaces to your container:\n\n```shell\ndocker run -d -p 8080:8080 -p 3306:3306 mdelapenya/tomcat-mysql\n```\n\nTest your deployment:\n\n```shell\ncurl http://localhost:8080/\n```\n\nTomcat 7.0.77's home page should appear.\n\n## Loading your custom Java application\n\nCopy the WAR file representing your application to `/opt/apache-tomcat-7.0.77/webapps/` folder:\n\n```shell\nFROM mdelapenya/tomcat-mysql:7.0.77\nCOPY yourapp.war /opt/apache-tomcat-7.0.77/webapps/yourapp.war\n```\n\nAfter that, build the new `Dockerfile`:\n\n```shell\ndocker build -t username/my-tomcat-mysql-app .\n```\n\nAnd test it:\n\n```shell\ndocker run -d -p 8080:80 -p 3306:3306 username/my-tomcat-mysql-app\n```\n\nTest your deployment:\n\n```shell\ncurl http://localhost:8080/yourapp\n```\n\nThat's it!\n\n## Connecting to the bundled MySQL server from within the container\n\nThe bundled MySQL server has a `root` user with no password for local connections.\nSimply connect from your Java code with this user (using sql2o library):\n\n```java\nString jdbcUrl = \"jdbc-url-connection\";\nString jdbcUser = \"jdbc-user\";\nString jdbcPassword = \"jdbc-password\";\n\nreturn new Sql2o(jdbcUrl, jdbcUser, jdbcPassword);\n```\n\n## Connecting to the bundled MySQL server from outside the container\n\nThe first time that you run the container, a new user `admin` with all privileges\nwill be created in MySQL with a random password. To get the password, check the logs\nof the container by running:\n\n```shell\ndocker logs $CONTAINER_ID\n```\n\nYou will see an output like the following:\n\n```shell\n========================================================================\nYou can now connect to this MySQL Server using:\n\n    mysql -uadmin -p47nnf4FweaKu -h\u003chost\u003e -P\u003cport\u003e\n\nPlease remember to change the above password as soon as possible!\nMySQL user 'root' has no password but only allows local connections\n========================================================================\n```\n\nIn this case, `47nnf4FweaKu` is the password allocated to the `admin` user.\n\nYou can then connect to MySQL:\n\n```shell\nmysql -uadmin -p47nnf4FweaKu\n```\n\nRemember that the `root` user does not allow connections from outside the container -\nyou should use this `admin` user instead!\n\n## Setting a specific password for the MySQL server admin account\n\nIf you want to use a preset password instead of a random generated one, you can\nset the environment variable `MYSQL_PASS` to your specific password when running the container:\n\n```shell\ndocker run -d -p 80:80 -p 3306:3306 -e MYSQL_PASS=\"mypass\" mdelapenya/liferay-portal-mysql\n```\n\nYou can now test your new admin password:\n\n```shell\nmysql -uadmin -p\"mypass\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdelapenya%2Fdocker-tomcat-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdelapenya%2Fdocker-tomcat-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdelapenya%2Fdocker-tomcat-mysql/lists"}