Spring Boot: Multistage Dockerfile and Spring Application Profiles

Kanan Rahimov
2 min readAug 21, 2023
Application profiles and Multistage Dockerfile for Spring Boot

I needed to automate the deployment process using GCP Cloud Run and Cloud Build for my NEST backend-as-a-service project.

One specific challenge was separating build and run processes using Dockerfile and Spring Profiles.

The reason for this is when the build runs in the GCP Cloud Build, the database is unavailable, so I…