← Back to Resources

Java Application Deployment with Claude Code

Overview

This CLAUDE.md template is for deploying Java applications using containers, focusing on Spring Boot applications with Podman/Docker.

Deployment Tasks

Download CLAUDE.md

Add this file to your Java deployment project to guide Claude Code through containerized deployments.

Download java-deployment.md

Sample Prompts

Try these prompts with Claude Code when using this CLAUDE.md:

Initial Deployment

Deploy this Spring Boot JAR to production using Podman. Set up PostgreSQL database, Caddy reverse proxy with automatic HTTPS for domain myapp.example.com. Use podman-compose for orchestration.

Health Check Configuration

Add health checks to my podman-compose.yml - the Spring Boot app has an actuator endpoint at /actuator/health on port 8080

Troubleshooting

My Spring Boot app can't connect to the PostgreSQL container. The error is 'java.net.UnknownHostException: postgres'. How do I fix container DNS resolution?

Migration

I have a running Docker Compose setup. Convert it to podman-compose format for Debian 13, using fully qualified image names.

Native Compilation

Convert my Spring Boot app to GraalVM native image. Update the Dockerfile to run the native binary instead of the JAR.

Tools & Documentation

Spring Boot

Spring Boot framework documentation and guides.

Spring Boot →

Podman

Daemonless container engine documentation.

Podman Docs →

Caddy Server

Automatic HTTPS reverse proxy and web server.

Caddy Docs →

GraalVM Native Image

Ahead-of-time compilation for Java applications.

GraalVM →

Safety Guidelines

  • 🧪 NEVER deploy to production without testing
  • ❤️ ALWAYS use health checks in container configs
  • 💾 BACKUP database before schema changes
  • 🔒 VERIFY DNS and SSL before go-live
  • 📋 Document rollback procedures