iI have a classic javaJava webapp. its It is composed of a database (postgresqlPostgreSQL), a servlet container (tomcatTomcat) and my code (deployed on tomcatTomcat as a *.war file).
iI want to package/deploy it using dockerDocker (mostly for testing for now), but imI'm unsure what would be the best way to "map" it.
myMy initial idea was to have an app-in-a-box - define a container that has javaJava, postgresPostgres and tomcatTomcat on it, exposing just the http port.
furtherFurther reading of the dockerDocker docs shows that this, although possible (install and run supervisord as the single foreground process, have it start both postgresPostgres and tomcatTomcat) is probably not the intended usage. going Going by the spirit of the tutorials iI should probably create a container for postgresPostgres, another for tomcatTomcat, and a data-container to hold the application code (my *.war) and database files. this This would mean 3+ containers (should the db files and *.war share the same data container?)
whatsWhat's the common practice here?
since iSince I have no previous experience with dockerDocker, what pitfalls can iI expect from each approach?
isIs there some other approach imI'm missing?