This talk tries to eliminate the idea that developing enterprise Java applications is nightmarish to create, setup and run in a consistent server and workstation and also eliminate the idea that Java Enterprise is not really catching up to the idea of cloud computing.
2. ● BUHAKE SINDI
● Senior Full Stack Java Developer
○ 15 years in Java EE
development
● Jakarta EE Ambassador
● Blogger, Podcaster, Beat Maker
WHO AM I?
3. ● Twitter: @EliteGentleman
● Email: buhake@gmail.com
● Everything else:
○ LinkTree: @theEliteGentleman
| Linktree
WHERE TO FIND ME?
4. OUTLINE OF THIS TALK
Docker Compose
03
Background story
01
Docker Basics
02
Q&A
06
Demo: Creating JavaEE
REST app running on
Payara + Postgres DB
on Docker.
04
Lessons Learnt
05
6. ● Developer teams with various
development tools and tech preferences.
● Various local development platforms:
○ MacOS
○ Windows
● Documentations and setup of various
applications to run locally are not
always easy to implement.
● Freedom to create and deploy apps fast
● Define and package application needs.
DEVELOPERS ISSUES
7. ● Dockerize & Deploy to the cloud
○ Eliminate the “But it works on my
machine!” excuse.
○ Reduce the time for project setup in
local development environment.
■ Useful, especially when hiring
junior developers.
○ Make deployment to cloud platform
simple.
DEVELOPERS SOLUTIONS
8. ● Java EE Web Application
○ Application Server: Payara 4.x and
higher
○ Database: PostgreSQL database
○ Elasticsearch
○ Etc.
PROJECT SETUP
10. Some Docker Vocabularies
Docker
Image
Docker
Registry
Cloud/server based
storage & distribution
service of your docker
images.
Docker
Container
The standard unit in which
the application service
resides and executes
Basis of a Docker
Container. Represents a
full application
Docker
Engine
An industry de facto
container runtime that
runs on various Linux and
Windows OS.
11. ● Is NOT a Virtual Machine (VM)
● Containers are app level construct.
○ Multiple containers can run on
the same machine sharing the
same OS kernel, each
container running on isolated
processes in user space.
● Container vs VM:
https://www.docker.com/resources/
what-container
Docker
12. ● A standard unit of software that
packages up code and all its
dependencies.
● Isolate apps from other apps.
● They share the same OS kernel.
● It’s lightweight and efficient.
● Works on all major Linux and
Windows Server
What is a container?
13. • A text-based script of
instructions that is
used to create a Docker
image.
• Contains a step of
“commands” that tells
Docker what to install,
run and to execute
effectively.
• Important to optimize
your Dockerfile
Dockerfile
16. What is Docker Compose?
Docker Compose is a tool for defining and running multi-container Docker applications.
1. Docker containers are all defined in a single YAML file called docker-compose.yml
2. Each container runs a particular component/service of your application so that they can be run in an isolated
environment.
3. Docker Compose will spin up all your containers with your single command.
● docker-compose up
17. ● Handle container dependencies
● Works with Docker Swarm,
Networking and Volumes
● Easily migrate the application to
Kubernetes
With Docker Compose…
23. OUTLINE OF THIS TALK
Use WSL/Git Bash on
Windows, especially
for volume mounts.
03
JVM versions (between
code build and
container runtime)
01
Out of storage space
(be careful)
02
Security! (e.g, never
store passwords in
Dockerfile)
Know what your Docker
image does
06
Persistent storage
must be outside your
Docker container
04
Basic knowledge of
Linux/Unix commands
05