Dockerfile with tomcat + mysql + filesystem app

Being a newbie to docker:

Right now I have a java web app running on tomcat, using mysql as database server, and writes to/reads from the filesystem.

  • How to change port mapping when linking Docker containers
  • Multiple Python Scripts in Docker
  • Docker and Java 9 modules
  • How to control fluentd log tag from Docker
  • Node cli program not working in windows machine
  • Customisation of the official Selenium Hub docker image returns 'Permission denied'
  • Am I supposed to put tomcat, mysql and filesystem resources on different containers (using official tomcat and mysql dockerfiles) and connect them somehow, OR do I write a dockerfile myself that combines everything in a single container?

    In the second case should I start with a base dockerfile, say an ubuntu one, and add mysql, java and tomcat to it by copying from their respective official dockerfiles?

  • Why does creating a file inside a docker-machine VM result in permission denied?
  • Is Postgres designed to write to shared data stores?
  • FTP Server for a Volume in Docker
  • Docker Swarm container reachable although port is not open?
  • How do I expose Kubernetes service to the internet?
  • Docker installation for running node and react environment
  • One Solution collect form web for “Dockerfile with tomcat + mysql + filesystem app”

    You can do either, but your first option is going to be more maintainable and more scalable in the long run.

    Composing a service from multiple containers means that you can take advantage of the work other people have already done to create standard images (like the mysql image). It also means that you can independently scale different parts of your application. Need more web front-ends? No problem! Need to use an existing database server or cluster instead of a container? No problem!

    A tool like docker-compose will help you maintain an application built from multiple containers.

    There are a number of quickstarts (e.g., this one) that might help you get started.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.