12factor

Using dotenv files with Spring Boot

不羁的心 提交于 2020-12-26 07:53:41
问题 I'd like to use dotenv files to configure my Spring Boot application. What is the best way to do this? In Ruby or Node world, I just creating .env file and it loads all stuff from there to application environment. I don't like to create separate profiles for my app etc. I just want to load any environment variables I specified in file into my app. 回答1: I have built a proper integration between Spring and dotenv. Follow this thread to understand the motivation. And then review the library:

Using dotenv files with Spring Boot

佐手、 提交于 2020-12-26 07:53:36
问题 I'd like to use dotenv files to configure my Spring Boot application. What is the best way to do this? In Ruby or Node world, I just creating .env file and it loads all stuff from there to application environment. I don't like to create separate profiles for my app etc. I just want to load any environment variables I specified in file into my app. 回答1: I have built a proper integration between Spring and dotenv. Follow this thread to understand the motivation. And then review the library:

Using dotenv files with Spring Boot

和自甴很熟 提交于 2020-12-26 07:53:13
问题 I'd like to use dotenv files to configure my Spring Boot application. What is the best way to do this? In Ruby or Node world, I just creating .env file and it loads all stuff from there to application environment. I don't like to create separate profiles for my app etc. I just want to load any environment variables I specified in file into my app. 回答1: I have built a proper integration between Spring and dotenv. Follow this thread to understand the motivation. And then review the library:

Tomcat, Docker, Logging, and STDOUT?

我的未来我决定 提交于 2019-12-14 02:23:18
问题 I'm running tomcat in docker, but I can't see the logs. They are written to various log files under tomcat/logs, but I can't see them when tomcat is running in a docker container. Here is my Dockerfile FROM tomcat:7-jre8 COPY target/MYAPP.war /usr/local/tomcat/webapps/MYAPP.war RUN ["/usr/local/tomcat/bin/catalina.sh", "start"] This is how I build image & start container from it: docker build -t MYAPP . docker run -it --rm -p 8080:8080 --name MYAPP MYAPP My app creates log file: /var/log

GA (or other javascript apps) configured and called in a 12Factor-y way

萝らか妹 提交于 2019-12-11 10:05:10
问题 My app consists of 2 pieces, 1 private management and 1 payment gateway, which are deployed to different urls: https://manage-my-app.com https://pay-my-app.com They need to be able to live on 1 server, however, with the domains are managed in the same vhost file. I want to configure Google Analytics to run separately on each of these urls, but to store as much of the configuration in Environment Variables as possible (conforming with 12Factor). I want to avoid using App Environments (dev,

Why does 12factor recommend not to daemonize processes?

我的未来我决定 提交于 2019-12-10 17:19:59
问题 12factor recommends not to daemonize processes. What are the disadvantages of doing so? 回答1: They are looking not at the daemon process itself, but at managing that process and ensuring it's running properly. They cite instances of kludgey frameworks built around daemons where the daemon was not written with an eye towards that management, thus requiring an excess of resources to restart it, clean up after it, etc. They point out and recommend the use of system management facility software,

12Factor App: Capturing stdout/stderr logs with Fluentd

耗尽温柔 提交于 2019-12-09 15:00:07
问题 By reading the following post from 12factor I have come up with a question I'd like to check how you guys handle this. Basically, an app should write directly to stdout/stderr. Is there anyway to redirect these streams directly to fluentd (not bound to rsyslog/syslog)? As I become more aware of fluentd, I believe it would be a great tool for log aggregation from multiple apps/platforms. The main reasoning for this is, if the app is cross-platform, rsyslog/syslog may not be available, and as I

Rendering an environment variable to the browser in a react.js redux production build running in different environments

我是研究僧i 提交于 2019-12-07 08:01:09
问题 The readme of the react redux realworld.io application at https://github.com/gothinkster/react-redux-realworld-example-app says to edit the src/agent.js to change the API_ROOT to point to a different backend api instance. We want to set things up so that API_ROOT can be defined by an environment variable that is different within the multiple environments (e.g., “staging” and “live”) where we run the production build. We are running in containers on openshift kubernetes following 12factor.net

12Factor App: Capturing stdout/stderr logs with Fluentd

梦想与她 提交于 2019-12-04 01:38:38
By reading the following post from 12factor I have come up with a question I'd like to check how you guys handle this. Basically, an app should write directly to stdout/stderr. Is there anyway to redirect these streams directly to fluentd (not bound to rsyslog/syslog)? As I become more aware of fluentd, I believe it would be a great tool for log aggregation from multiple apps/platforms. The main reasoning for this is, if the app is cross-platform, rsyslog/syslog may not be available, and as I understand, using logging frameworks (which need the required configuration for them to work) would be

How to pass environment variables to a frontend web application?

淺唱寂寞╮ 提交于 2019-11-29 20:30:05
I am trying to containerize a frontend web application and I am having troubles to figure out how to pass environment variables. The application is a Angular application, so it is 100% client-side. In a typical backend service, passing environment variables is easy, as everything is running on the same host, so the environment variables can be easily picked by the backend service. However, in a frontend application, this is different: the application is running in the browser of the client. I want to configure my application via environment variables, as this makes deployment much easier. All