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.

  • iptables not working on macvlan traffic in container
  • Copy file to a Docker container before starting it
  • How can I start a Docker container on boot in OS X?
  • Dockerfile can't copy files. (“cp” command)
  • Can not pull docker image
  • Docker compose and Spring boot: scale command starts container without environment variables
  • 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?

  • Docker: Connecting to external database
  • How to add couchdb server into docker creation file
  • Make one Docker Compose service know the domain name of another
  • docker Mule-server curl: (56) Recv failure: Connection reset by peer
  • How to link to additional container without restarting?
  • Sending build context to Docker daemon (it doesn't stop)
  • 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.