All Projects → f-lopes → spring-boot-docker

f-lopes / spring-boot-docker

Licence: other
Lightweight Spring Boot Docker image based on Alpine + Docker Compose file

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to spring-boot-docker

drupal-php
PHP docker container image for Drupal
Stars: ✭ 56 (+124%)
Mutual labels:  alpine
dockerfiles-nginx-auth-ldap
Nginx on Alpine with LDAP authentication module from kvspb/nginx-auth-ldap
Stars: ✭ 25 (+0%)
Mutual labels:  alpine
packages
Cloud Posse DevOps distribution of linux packages for native apps, binaries, alpine packages, debian packages, and redhat packages.
Stars: ✭ 107 (+328%)
Mutual labels:  alpine
docker-alpine-bash
Docker image with Bash and complete utils (busybox replacements) (10MB)
Stars: ✭ 25 (+0%)
Mutual labels:  alpine
alpinist
Automatic Alpine Linux Package (apk) Repository Generation using AWS Lambda, S3 & SSM Parameter Store
Stars: ✭ 45 (+80%)
Mutual labels:  alpine
docker-alpine-gcc
The smallest Docker image with C compiler (GCC) (130MB)
Stars: ✭ 48 (+92%)
Mutual labels:  alpine
mage2docker
A performant, replicable, and production-like alpine Magento 2 local development environment that leverages Docker.
Stars: ✭ 37 (+48%)
Mutual labels:  alpine
docker-jitsi-meet
Docker Jitsi Meet WebRTC conferencing system w/Prosody XMPP and s6 overlay
Stars: ✭ 66 (+164%)
Mutual labels:  alpine
rapide
WIP! do not use just yet - Opinionated Vite + Alpine.js starter PWA template
Stars: ✭ 15 (-40%)
Mutual labels:  alpine
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (-16%)
Mutual labels:  alpine
dcos-k8s-rust-skaffold-demo
A demo of pipelining Rust application development to Kubernetes on DC/OS with Skaffold.
Stars: ✭ 40 (+60%)
Mutual labels:  alpine
alpine-php-wordpress
Wordpress running on Alpine Linux [Docker]
Stars: ✭ 30 (+20%)
Mutual labels:  alpine
alpine-grav
Grav running on Alpine Linux [Docker]
Stars: ✭ 14 (-44%)
Mutual labels:  alpine
docker-dolibarr
🐳 🐘 Docker image for Dolibarr.
Stars: ✭ 58 (+132%)
Mutual labels:  alpine
docker-base
Just enough to get process supervision and startup mechanisms
Stars: ✭ 25 (+0%)
Mutual labels:  alpine
docker-jre
Lean JRE 8 Docker container
Stars: ✭ 25 (+0%)
Mutual labels:  alpine
alpine-buildpack-deps
An attempt at a "buildpack-deps"-like Docker image with Alpine Linux
Stars: ✭ 30 (+20%)
Mutual labels:  alpine
SyntaxNet-Tensorflow
Minimal Tensorflow Docker image with SyntaxNet/DRAGNN based on Alpine linux
Stars: ✭ 35 (+40%)
Mutual labels:  alpine
docker-flask
Alpine + Docker + Flask + Gunicorn + Supervisor
Stars: ✭ 16 (-36%)
Mutual labels:  alpine
docker-nagios
Docker image for Nagios Core in Alpine Linux with basic plugins, available for x86, x64 , ARM v6, ARM v7 and ARM64.
Stars: ✭ 33 (+32%)
Mutual labels:  alpine

Lightweight Spring Boot Docker image based on Alpine + Docker Compose file

Build Status

Features:

Available environment variables

Name Default Description
JAVA_OPTS JAVA_OPTS
DEBUG false Enable or disable debug mode
DEBUG_PORT 8000 Debug port

How to use ?

  1. Simply extend your image from flopes/spring-boot-docker and set your application name as an environment variable:

    FROM flopes/spring-boot-docker:1.1
    
  2. Copy your Spring Boot executable jar into an assets folder, rename it to spring-boot.jar and build you image: docker build -t spring-boot-image .

  3. Start your application:

    • Using Docker CLI docker run -d -p 8080:8080 spring-boot-image

    • Using the provided docker-compose.yml in the sample directory: docker-compose up -d

Inject environment variables:

docker run -d -p 8080:8080 -e JAVA_OPTS="-Xms256m -Xmx512m" spring-boot-image

Using Docker Compose

The docker-compose.yml file picks its configuration from the .env one.

Using this file, you can set the desired properties:

# Application properties
SERVER_PORT=8080
DEBUG_PORT=8000
SPRING_PROFILES_ACTIVE=dev
DEBUG=false
# -Dprop=... -Dparameter=...
JAVA_OPTS=

# Host properties
HOST_SERVER_PORT=8080
HOST_DEBUG_PORT=8000

Debug mode

To run the application in debug mode, simply set the DEBUG variable to true in the .env file.

Launch the application: docker-compose up -d

By default, the debug port used is the 8000.

Spring profile(s)

By default, the application will run with dev Spring profile

To run the application with a specific Spring profile, set the desired one in the .env file:

SPRING_PROFILES_ACTIVE=dev

PID 1

$ docker run -d --name spring-boot -p 8080:8080 spring-boot-extends
a5b3036136dffa34af0cdeff6153e87f9a20ba1cdc54c36fe9113b385bfb3264

lopes_f@lopes-f-laptop MINGW64 /d/WORK/git/docker-poc/docker (develop)
$ docker exec -it a5b3036136dffa34af0cdeff6153e87f9a20ba1cdc54c36fe9113b385bfb3264 sh
/app $ ps -ef
PID   USER     TIME   COMMAND
    1 spring-b   0:10 java -Djava.security.egd=file:/dev/./urandom -jar /app/spring-boot.jar
   23 spring-b   0:00 sh
   27 spring-b   0:00 ps -ef
/app $
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].