Using properties files with Flexible Environment Java 8 on Google App Engine

Introduction

How to use a configuration file such as a properties file on GAE's Flex Java 8.

TL; DR

Place to put

In App Engine, the built war file etc. are archived with tar and expanded in the Docker container on the App Engine side. So you need to include the config file in the tar as well.

If you put it in WEB-INF, it will be included in war.

So if you put config.properties like this, it's OK.

.
└── src
    └── main
        ├── appengine
        │   └── app.yaml
        ├── java
        │   └── ...
        ├── main.iml
        └── webapp
            └── WEB-INF
                ├── appengine-web.xml
                ├── config.properties
                └── web.xml

The tar also contains Dockerfile, app.yaml, war files, etc.

Where to look

In GAE Flex, tar is expanded to Docker container as mentioned above.

WEB-INF is expanded to/ var / lib / jetty / webapps / root / WEB-INF /. So you can read the properties file from here.

The working directory of the app will be / var / lib / jetty, so you can also specify it with a relative path.

Recommended Posts

Using properties files with Flexible Environment Java 8 on Google App Engine
Building a development environment with Maven on Google App Engine [Java]
Hello World with Google App Engine (Java 8) + Spring Boot + Gradle
Deploy your Go app on Google App Engine with GitHub Actions
Hello World with Google App Engine (Java 11) + Spring Boot + Gradle
Google App Engine development with Docker
Java 1 1 support from Google App Engine
Use ndb.tasklet on Google App Engine
[Python] Run Flask on Google App Engine
Use external modules on Google App Engine
I can't deploy with google app engine
Deploy a Python app on Google App Engine and integrate it with GitHub
Tweet (API 1.1) on Google App Engine for Python
Deploy a Django application on Google App Engine (Python3)
Google App Engine / Python development environment construction procedure (late 2014)
(Beginner) Basic usage of Datastore on Google App Engine
Getting Started with Google App Engine for Python & PHP
How to use Django on Google App Engine / Python
Runtime version of Google App Engine / Python Standard Environment
How to connect to Cloud SQL PostgreSQL on Google Cloud Platform from a local environment with Java
Launching a machine learning environment using Google Compute Engine (GCE)
Publish the site for free on Google App Engine (personal memorandum)
Read, change, and write Excel files on GCP App Engine Storage
Build a Python execution environment using GPU with GCP Compute engine
[Google App Engine] Flow from development environment construction to application creation
Notes on using rstrip with python.
Using Chainer with CentOS7 [Environment construction]
Play with Turtle on Google Colab
Until you deploy a SpringBoot project in Gradle on App Engine Flexible
[Detailed version] Creating a comfortable Python environment with Google Compute Engine (Ubuntu 16.04)