简体   繁体   中英

How to deploy .env and api_config.properties to Google App engine?

I m new on java, i'm new on google cloud...so maybe my questions can sound stupid. I tried to find before to ask...but i dont found.

I'm triing to deploy a Java app to Google App engine. After a lot of tries i managed to compile the JAR with maven and deploy it to the cloud. I can see that its working with the logs (gcloud app logs). Now the problems i have are:

-I need to include a few files, configuration files, .env, api_config.properties etc... How can i do it? I tried to use include in the app.yaml but it doesnt find the file (ERROR: gcloud crashed (IncludeFileNotFound)) so i suppose this is not the way.

-I need to connect to a postegre instance. This part i didnt try it for now, so i dont know if i will have problems. As i understand i need to create a vm instance with a postegre sql server running on it (i will use bitnami postgre image) i dont need to open ports as it will be a conection from the inside, im right?

edit: and now i see that its really not connecting the webserver that my app is creating with the app url. that shows "502 Bad Gateway nginx" message. I supose its because its listening on port 80 instead of 8080, because its not loading it from the config file.

In your app.yaml, you may define an env_variables section. This is in my opinion the best way to store configuration data, sensitive or not.

Regarding accessing files please see the options here .

The most fitting for your use case is probably the Cloud Storage .

If you want to update the configuration files when you deploy to app engine, i suggest that you create some deployment method that will include uploading the configuration files to Cloud Storage if they need to be updated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM