Skip to main content

Rehearse the production profile

Run a prepared application image locally with the prod profile and PostgreSQL. Check what is running, wait for readiness, and confirm that an invented record survives an application restart. This is a local operational rehearsal, not a cloud deployment or permission to launch a live service.

Use a disposable copy of the permit application from the earlier tutorials, with its matching image already built and its deploy/demo stack prepared by the environment owner. The owner must supply the local configuration and approved sign-in method through the project's existing process. Do not put credential values in this tutorial, the repository, terminal transcripts or exercise evidence. If that preparation is missing, stop at the source review below.

The exercise expects the generated stack's app and db services, a PostgreSQL 16 database with persistent storage, and a local HTTP endpoint supplied by the owner. The owner should bind that endpoint to loopback and choose an unused port. A stack with extra identity or storage services must also have those dependencies prepared. Use invented data only. Do not point the application at an existing live database.

Read the image and environment contract​

In the application's source, inspect Dockerfile, src/main/resources/application-prod.properties, and deploy/demo/compose.yml. These source files describe settings; do not open or copy the private environment file to complete this lesson.

The generated image builds the production frontend bundle, runs Java as a non-root user, selects SPRING_PROFILES_ACTIVE=prod, and uses /data for persistent local application files. The production profile takes its database settings from the environment. In the generated Compose source, JCM_DB_URL points to the db service and that service uses postgres:16. The database and application have separate persistent volumes.

A production profile does not make a local demo production-ready. It also does not enable development editing: the packaged image excludes the development profile, and studio editing stays off unless separately configured. Read the image reference and production settings before changing those assumptions. The image tag is a convenient name; record the actual image ID used for this rehearsal so that a later rebuild is distinguishable.

Confirm the source revision, prepared image, disposable Compose project, loopback URL and data-retention plan with the environment owner. Review the three source files above. Confirm PostgreSQL 16 and persistent volumes, and that the exercise has permission to start and restart only this local project's application.

Start the prepared stack​

Work in the application's deploy/demo folder. The following commands are examples for the owner-prepared stack. They are not an environment-setup script and do not supply missing configuration.

cd deploy/demo
docker compose up -d
docker compose ps

Do not use a whole configuration or environment dump as evidence; it can expose resolved secret values. Record only the source revision, service names, image IDs, database version and status needed for the exercise.

docker image inspect "$(docker compose images -q app)" --format '{{.Id}} {{.Config.User}} {{.Architecture}}'
docker compose exec -T app printenv SPRING_PROFILES_ACTIVE
docker compose exec -T db psql -U jcm -d jcm -tAc 'select version()'

Start the prepared local stack and inspect its status. Record the application image ID, non-root image user and architecture. Read only SPRING_PROFILES_ACTIVE from the application; it should say prod. Query the local db service's version and record PostgreSQL 16. If the expected services or database identity differ, reconcile the prepared stack before continuing. Do not substitute an in-memory startup check for the PostgreSQL result.

The version query proves which database server answers the query. The source connection mapping and successful application startup are separate evidence that the application uses that service. An owner-customized mapping requires its own review; a healthy but unrelated PostgreSQL container is insufficient.

Wait for readiness​

Use the loopback base URL supplied for this exercise. Check /actuator/health/liveness and /actuator/health/readiness. For example, if the prepared app uses port 18080:

curl --fail --silent --show-error http://127.0.0.1:18080/actuator/health/liveness
curl --fail --silent --show-error http://127.0.0.1:18080/actuator/health/readiness

Wait for successful readiness at the actual prepared URL and record the HTTP result and status word. Liveness alone is insufficient. If readiness stays down, use the relevant non-sensitive startup refusal and the environment owner's configuration review to resolve it. Do not disable a blocking check simply to continue the exercise.

Readiness covers the application's configured checks; it is not proof of every business journey, backup, access rule or external service. The health reference explains the probes and database reference explains supported databases.

Save a record and restart the application​

Using the approved sign-in method, create a permit for the invented applicant Maple Workshop rehearsal. Save it, note its case number, leave the page and reopen the same permit. Record that its applicant and case number match. Keep sign-in details out of screenshots and the exercise record.

Restart only the application service in this disposable project:

docker compose restart app

Restart app, wait for readiness again, and sign in through the approved method. Open the saved permit by its recorded case number and confirm the applicant is still Maple Workshop rehearsal. Record the result and the unchanged image ID. If it is missing, investigate the database mapping and volumes; do not create a replacement record and count that as persistence.

This checks persistence across an application restart. It does not test a database restore, container replacement, schema upgrade, image rollback or file recovery. Those require separate exercises and evidence. In particular, changing an image back does not undo a database migration.

Finish and keep the evidence​

Record the source revision, image ID, PostgreSQL version, local project and URL, readiness results, saved case number and restart outcome. List unexpected results and any step you did not execute. Agree with the environment owner whether this local stack should stay running or stop; preserve its volumes while retaining the exercise. Do not remove another project's containers or storage.

For an owned rehearsal that should stop, docker compose stop in its deploy/demo folder stops the services without deleting the volumes. Removing volumes erases the saved database and files; it is not a routine restart step.

A real release still needs reviewed identity and access, licensing and environment bindings, storage, backup and restore evidence, monitoring, upgrade/recovery plans and an explicit release decision. Keep the local rehearsal result tied to the image that actually ran. A passing jcm check or a successful docs build is useful additional evidence, but neither replaces this image-on-PostgreSQL exercise.