#Handling properties when deploying a Java app as a container

1 messages · Page 1 of 1 (latest)

deep vapor
#

The app is a Spring app (not Spring boot) deployed on a VM (not in the cloud) using Jetty. Today we have a bunch of property and config files that differ per environment (local/sys, acc, prod). Right now, as part of our build, 3 different zip files are built for each environment, and we take these zip files to teh respective environment and replace them when needed. This involves a bunch of manual steps and is very error prone.

The goal is to move towards the cloud and deploy it in a Docker container using Azure Container Apps. I have very limited experience with containers and Azure, and none with Azure Container Apps.

One of the things I'm working on right now is understanding how properties are usually handled when working with containers and deployment in Azure.

My understanding is that properties should not be part of the built image, which makes sense. Today the properties are not part of the war deployed to Jetty, which enables us to shut down the app, change a property and start it back up without having to redeploy. We want to keep this functionality when moving to containers.

My question is:
How should we set it up in Azure so that we can read properties from the container at startup, and still have different properties for each environment? I'm imagining some solution where each container deployed is provided an environment flag (SYS, ACC, PROD), and then reads the correct version of a property from somewhere. I'm thankful for straight up solutions, links to good tutorials/documentations and general tips.

Thanks!

winter jasperBOT
#

<@&987246399047479336> please have a look, thanks.

winter jasperBOT
#

@deep vapor

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

deep vapor
#

Still relevant. I guess I can clarify the question by saying that I'm not necessarily looking for tips directly relating to Azure and container apps, just general advice for containers and handling of properties is welcome as well

thorn stirrup
#

I think you can pass environment variables when running a Docker container. You can use an env file as well

#

Using the --env-file flag when running your container

thin oar
#

Leverage azure key vault, and the used vault differs per environment.

quiet ginkgo
#

a config file is the best for container buildfile