Skip to content

Commit e130414

Browse files
committed
[chore] application.properties 로컬용 만들고 서버에는 .env를 통해서 변수관리 하게 변경
1 parent 67505eb commit e130414

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ services:
4242

4343
backend-prod:
4444
image: ghcr.io/gachigage/gachigage-backend:prod
45+
env_file:
46+
-./.env
4547
container_name: gachigage-backend-prod
4648
environment:
4749
- SPRING_PROFILES_ACTIVE=prod
@@ -60,6 +62,8 @@ services:
6062

6163
backend-dev:
6264
image: ghcr.io/gachigage/gachigage-backend:dev
65+
env_file:
66+
- ./.env.dev
6367
container_name: gachigage-backend-dev
6468
environment:
6569
- SPRING_PROFILES_ACTIVE=dev

src/main/java/com/gachigage/image/service/FakeImageUploader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.springframework.web.multipart.MultipartFile;
88

99
@Component
10-
@Profile("test")
10+
@Profile({"test", "local"})
1111
public class FakeImageUploader implements ImageUploader {
1212

1313
@Override
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spring.config.import=optional:file:.env.local[.properties]
2+
spring.jpa.hibernate.ddl-auto=update

src/main/resources/application.properties

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
spring.config.import=optional:file:.env[.properties]
21
spring.application.name=gachigage
32
server.servlet.context-path=/api
43
front.url=${FRONT_URL}
@@ -15,8 +14,8 @@ spring.jpa.properties.hibernate.format_sql=true
1514
spring.jpa.properties.hibernate.highlight_sql=true
1615
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
1716
# Sprint Security Oauth2
18-
spring.security.oauth2.client.registration.kakao.client-id=${OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT-ID}
19-
spring.security.oauth2.client.registration.kakao.client-secret=${OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT-SECRET}
17+
spring.security.oauth2.client.registration.kakao.client-id=${OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT_ID}
18+
spring.security.oauth2.client.registration.kakao.client-secret=${OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT_SECRET}
2019
spring.security.oauth2.client.registration.kakao.client-authentication-method=client_secret_post
2120
spring.security.oauth2.client.registration.kakao.authorization-grant-type=authorization_code
2221
spring.security.oauth2.client.registration.kakao.redirect-uri={baseUrl}/login/oauth2/code/{registrationId}
@@ -26,10 +25,10 @@ spring.security.oauth2.client.provider.kakao.token-uri=https://kauth.kakao.com/o
2625
spring.security.oauth2.client.provider.kakao.user-info-uri=https://kapi.kakao.com/v2/user/me
2726
spring.security.oauth2.client.provider.kakao.user-name-attribute=id
2827
# NCP Maps
29-
naver.maps.client-id=${NAVER_MAPS_CLIENT-ID}
30-
naver.maps.client-secret=${NAVER_MAPS_CLIENT-SECRET}
31-
naver.maps.base-url=${NAVER_MAPS_BASE-URL}
28+
naver.maps.client-id=${NAVER_MAPS_CLIENT_ID}
29+
naver.maps.client-secret=${NAVER_MAPS_CLIENT_SECRET}
30+
naver.maps.base-url=${NAVER_MAPS_BASE_URL}
3231
# NCP S3
33-
naver.s3.key-id=${NAVER_S3_KEY-ID}
34-
naver.s3.secret-key=${NAVER_S3_SECRET-KEY}
35-
naver.s3.bucket-name=${NAVER_S3_BUCKET-NAME}
32+
naver.s3.key-id=${NAVER_S3_KEY_ID}
33+
naver.s3.secret-key=${NAVER_S3_SECRET_KEY}
34+
naver.s3.bucket-name=${NAVER_S3_BUCKET_NAME}

src/test/resources/application.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)