νκ²½λ³μ
- μμ£Ό λ³κ²½λκ±°λ νμ λμ§ μμ λ°μ΄ν°
- μμ€μ λ°μ λ£μΌλ©΄ μλλ μ 보
- κ°μ μ©λμ΄μ§λ§ κ°λ°, ν
μ€νΈ, μ΄μ λ± λ€μν 쑰건λ§λ€ λ€λ₯Έ λ°μ΄ν°
- DB 컀λ₯μ
μ 보
- μΈλΆ μ°λ URL μ 보
- νκ²½λ³μκ° μ€μν μ΄μ ?
- μμ€ν
μ μ μ°μ±
- Docker μ΄λ―Έμ§
νκ²½λ³μ μμΉ
- μμ€ν
νκ²½λ³μ
- properties, YAML νμΌ
- ν΄λμ€ μμ
- Spring without Profile
- μ½κ° 무μν(?) λ°©λ²
- Mavenκ³Ό Profile κΈ°λ₯ κ·Έλ¦¬κ³ , properties
mvn -Pνλ‘νμΌλͺ
install
- Maven Profile
- μ₯μ : μ€νλ§ μ ν리μΌμ΄μ
μμλ λ¨μν μ€μ νν μ μ§
Code
@Value("${REFRESH_TOKEN}")
private String rToken;
@Value("${spring.datasource.hikari.username}")
private String username;
- Properties with default value
# application.properties
spring.datasource.hikari.jdbc-url=${JDBC_URL:localhost}
spring.datasource.hikari.username=${DB_USER:devuser}
spring.datasource.hikari.password=${DB_PASS:devpass}
Docker env
# docker version 20+
docker run -p 8080:8080 -e DB_USER -e DB_PASS -e JDBC_URL kenu/sb-kenu
# docker version 19+ in AWS EC2
sudo usermod -a -G docker ec2-user
# re login
docker run -e DB_USER=${DB_USER} -e DB_PASS=$DB_PASS -e JDBC_URL=$JDBC_URL -p 8080:8080 kenu/aop-demo
λμμ
related