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.

  • Accessing Elastic Beanstalk environment properties in Docker
  • Using docker within vagrant behind a proxy
  • Best way for debugging docker build error
  • Docker Java Client API Connection Pool
  • serverspec command returning blank strings
  • How do you put your source code into Kubernetes?
  • 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?

  • Container ifconfig & nslookup IPs don't match
  • Assign different public IPs to different Docker container
  • Postgres shuts down immediately when started with docker-compose
  • Assigning IP address to docker containers?
  • Bypass install configuration in dockerfile
  • How can docker downloading new image output log messages can be supressed?
  • 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.