<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x" -->

---
title: Spring Boot: Build URL Shortener Application - Part 12:...
description: Final part of a URL shortener build series covering how to dockerize a Spring Boot application. Shows using Spring Boot's Maven plugin with Cloud Native...
canonical: https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application | daily.dev
og:description: Final part of a URL shortener build series covering how to dockerize a Spring Boot application. Shows using Spring Boot's Maven plugin with Cloud Native...
og:url: https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x
og:image: https://api.daily.dev/og/posts/UcuwneF2X.png
og:image:alt: Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 8 min read · 0 upvotes · 0 comments

## Summary

Final part of a URL shortener build series covering how to dockerize a Spring Boot application. Shows using Spring Boot's Maven plugin with Cloud Native Buildpacks to generate a Docker image without writing a Dockerfile, configuring a default image name in pom.xml, and setting up Docker Compose with two services (PostgreSQL and the app) so both run as containers. Also explains overriding application.properties values (like datasource URL, username, password) via environment variables by capitalizing keys and replacing dots with underscores, and fixes a small authorization bug found while testing the containerized app.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=su9Z0d2YHhs>

## Questions this post answers

### How can I build a Docker image from a Spring Boot application without writing a Dockerfile?

Spring Boot integrates with Cloud Native Buildpacks through its Maven and Gradle plugins, so running the Maven wrapper command spring-boot:build-image generates a Docker image automatically. The image name can be customized by setting spring-boot.build-image.image-name in the command line or as a default in pom.xml, and Docker must be running locally since the build uses the Docker engine.

_Building containerized microservices? daily.dev surfaces practical Spring Boot and Docker workflows like this one._

### How do I override Spring Boot application.properties values using environment variables in Docker Compose?

Convert the property key to uppercase and replace dots with underscores, for example spring.datasource.url becomes SPRING_DATASOURCE_URL. Environment variables set in Docker Compose take priority over values in application.properties, which lets the same image use different database hosts, usernames, and passwords across local, QA, and production environments without code changes.

_Deploying the same Spring Boot image across environments? daily.dev tracks configuration patterns like this for backend teams._

## Similar posts on daily.dev

- [Dockerizing a Java 26 Project with Docker Init](https://daily.dev/posts/dockerizing-a-java-26-project-with-docker-init-n0yaflgv8) · Foojay.io · 30 upvotes · 0 comments
- [Building the Perfect Docker Image for a Java app](https://daily.dev/posts/building-the-perfect-docker-image-for-a-java-app-wf0dbjzj1) · Vaadin · 1 upvotes · 0 comments
- [Spring Boot tutorial: Get started with Spring Boot](https://daily.dev/posts/spring-boot-tutorial-get-started-with-spring-boot-itnz41zwx) · InfoWorld · 1 upvotes · 0 comments
- [Kubernetes Made Simple: A Guide for JVM Developers](https://daily.dev/posts/kubernetes-made-simple-a-guide-for-jvm-developers-rxakzp1bn) · JetBrains · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#docker](https://daily.dev/tags/docker), [#postgresql](https://daily.dev/tags/postgresql), [#spring-boot](https://daily.dev/tags/spring-boot), [#docker-compose](https://daily.dev/tags/docker-compose)

[View this post on daily.dev](https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application","url":"https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x"},"datePublished":"2026-09-27T07:26:43.993Z","dateModified":"2026-09-27T07:53:37.384Z","description":"Final part of a URL shortener build series covering how to dockerize a Spring Boot application. Shows using Spring Boot's Maven plugin with Cloud Native...","image":"https://i.ytimg.com/vi/su9Z0d2YHhs/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/su9Z0d2YHhs/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,docker,postgresql,spring-boot,docker-compose","timeRequired":"PT8M","video":{"@type":"VideoObject","name":"Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application","description":"Final part of a URL shortener build series covering how to dockerize a Spring Boot application. Shows using Spring Boot's Maven plugin with Cloud Native...","thumbnailUrl":"https://i.ytimg.com/vi/su9Z0d2YHhs/sddefault.jpg","uploadDate":"2026-09-27T07:26:43.993Z","duration":"PT8M","url":"https://api.daily.dev/r/UcuwneF2X","embedUrl":"https://www.youtube.com/embed/su9Z0d2YHhs"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Spring Boot: Build URL Shortener Application - Part 12: Dockerizing Spring Boot Application"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spring-boot-build-url-shortener-application---part-12-dockerizing-spring-boot-application-ucuwnef2x#faq","mainEntity":[{"@type":"Question","name":"How can I build a Docker image from a Spring Boot application without writing a Dockerfile?","acceptedAnswer":{"@type":"Answer","text":"Spring Boot integrates with Cloud Native Buildpacks through its Maven and Gradle plugins, so running the Maven wrapper command spring-boot:build-image generates a Docker image automatically. The image name can be customized by setting spring-boot.build-image.image-name in the command line or as a default in pom.xml, and Docker must be running locally since the build uses the Docker engine. Building containerized microservices? daily.dev surfaces practical Spring Boot and Docker workflows like this one."}},{"@type":"Question","name":"How do I override Spring Boot application.properties values using environment variables in Docker Compose?","acceptedAnswer":{"@type":"Answer","text":"Convert the property key to uppercase and replace dots with underscores, for example spring.datasource.url becomes SPRING_DATASOURCE_URL. Environment variables set in Docker Compose take priority over values in application.properties, which lets the same image use different database hosts, usernames, and passwords across local, QA, and production environments without code changes. Deploying the same Spring Boot image across environments? daily.dev tracks configuration patterns like this for backend teams."}}]}
```

