/java-maven-docker

Simple dockerized Maven project

Primary LanguageJava

Java Maven Docker

Build Status

Simple dockerized Maven project with Java 8.

Created with

mvn -B archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DgroupId=com.mycompany.myapp \
  -DartifactId=myapp

Getting Started

Install dependencies

mvn install

Run

mvn exec:java

Docker

Build

docker build --no-cache --rm --tag=myapp .

Run

docker run --publish 4567:4567 --rm --name=myapp myapp mvn exec:java

Using Docker-Compose

Inside docker-compose.yml:

myapp:
  build: .
  command: mvn exec:java
  ports:
    - "4567:4567"

Run it with:

docker-compose up -d