diff --git a/backend/apigateway/Dockerfile b/backend/apigateway/Dockerfile index 459796a..677dcad 100644 --- a/backend/apigateway/Dockerfile +++ b/backend/apigateway/Dockerfile @@ -1,8 +1,7 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org +RUN mkdir -p /usr/app/msa-attach-volume/messages # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 @@ -11,5 +10,5 @@ WORKDIR $APP_HOME COPY build/libs/*.jar apigateway.jar # application port EXPOSE 8000 -# 실행 (application-cf.yml 프로필이 기본값) -CMD ["java", "-Dspring.profiles.active=${profile:cf}", "-jar", "apigateway.jar"] +# 실행 +CMD ["java", "-Dspring.profiles.active=${profile:default}", "-jar", "apigateway.jar"] diff --git a/backend/apigateway/manifest.yml b/backend/apigateway/manifest.yml index eaa0d95..bbff6ae 100644 --- a/backend/apigateway/manifest.yml +++ b/backend/apigateway/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-apigateway # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/apigateway/src/main/java/org/egovframe/cloud/apigateway/config/MessageSourceConfig.java b/backend/apigateway/src/main/java/org/egovframe/cloud/apigateway/config/MessageSourceConfig.java index b070d64..37cc76f 100644 --- a/backend/apigateway/src/main/java/org/egovframe/cloud/apigateway/config/MessageSourceConfig.java +++ b/backend/apigateway/src/main/java/org/egovframe/cloud/apigateway/config/MessageSourceConfig.java @@ -36,7 +36,7 @@ import java.nio.file.Paths; @Configuration public class MessageSourceConfig { - @Value("${messages.directory}") + @Value("${messages.directory:${user.home}/msa-attach-volume/messages}") private String messagesDirectory; @Value("${spring.profiles.active:default}") diff --git a/backend/apigateway/src/main/resources/application.yml b/backend/apigateway/src/main/resources/application.yml index 342185a..cf48228 100644 --- a/backend/apigateway/src/main/resources/application.yml +++ b/backend/apigateway/src/main/resources/application.yml @@ -65,3 +65,6 @@ management: web: exposure: include: refresh, health, beans + +messages: + directory: ${user.dir}/msa-attach-volume/messages diff --git a/backend/apigateway/src/main/resources/bootstrap.yml b/backend/apigateway/src/main/resources/bootstrap.yml index 6bf9cc8..cb13949 100644 --- a/backend/apigateway/src/main/resources/bootstrap.yml +++ b/backend/apigateway/src/main/resources/bootstrap.yml @@ -2,4 +2,5 @@ spring: cloud: config: uri: http://localhost:8888 - name: apigateway + name: application + enabled: true diff --git a/backend/board-service/Dockerfile b/backend/board-service/Dockerfile index bd86ccf..1f91f39 100644 --- a/backend/board-service/Dockerfile +++ b/backend/board-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 @@ -11,5 +9,5 @@ WORKDIR $APP_HOME COPY build/libs/*.jar app.jar # application port #EXPOSE 8000 -# 실행 (application-cf.yml 프로필이 기본값) -CMD ["java", "-Dspring.profiles.active=${profile:cf}", "-jar", "app.jar"] +# 실행 +CMD ["java", "-Dspring.profiles.active=${profile:default}", "-jar", "app.jar"] diff --git a/backend/board-service/manifest.yml b/backend/board-service/manifest.yml index 9897f1d..83fa457 100644 --- a/backend/board-service/manifest.yml +++ b/backend/board-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-board-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/config/Dockerfile b/backend/config/Dockerfile index 2fc2036..c6a9267 100644 --- a/backend/config/Dockerfile +++ b/backend/config/Dockerfile @@ -9,5 +9,5 @@ WORKDIR $APP_HOME COPY build/libs/*.jar config.jar # application port EXPOSE 8888 -# 실행 (ARG 아니고 ENV 값이다) -CMD ["java", "-Dspring.profiles.active=${profile:prod}", "-jar", "config.jar"] +# 실행 +CMD ["java", "-Dspring.profiles.active=${profile:native}", "-jar", "config.jar"] diff --git a/backend/config/src/main/resources/application.yml b/backend/config/src/main/resources/application.yml index 2a97f00..5acb437 100644 --- a/backend/config/src/main/resources/application.yml +++ b/backend/config/src/main/resources/application.yml @@ -5,13 +5,12 @@ spring: application: name: config-service profiles: - active: native,default # native file repository + active: native # native file repository cloud: config: server: native: - search-locations: file:///${user.home}/workspace.edu/egovframe-msa-edu/config # Windows - # search-locations: file://${user.home}/workspace.edu/egovframe-msa-edu/config # MacOS + search-locations: file:///usr/app/config # docker rabbitmq: host: localhost port: 5672 diff --git a/backend/config/src/main/resources/bootstrap.yml b/backend/config/src/main/resources/bootstrap.yml index 250aee9..2e25268 100644 --- a/backend/config/src/main/resources/bootstrap.yml +++ b/backend/config/src/main/resources/bootstrap.yml @@ -1,2 +1,2 @@ encrypt: - key: egovframe # 대칭키 임의의 값 \ No newline at end of file + key: egovframe # 대칭키 임의의 값 diff --git a/backend/config/src/main/resources/logback-spring.xml b/backend/config/src/main/resources/logback-spring.xml index cab0c63..6f496fa 100644 --- a/backend/config/src/main/resources/logback-spring.xml +++ b/backend/config/src/main/resources/logback-spring.xml @@ -8,12 +8,12 @@ - + - + diff --git a/backend/discovery/manifest.yml b/backend/discovery/manifest.yml index 923636a..871e4ed 100644 --- a/backend/discovery/manifest.yml +++ b/backend/discovery/manifest.yml @@ -8,7 +8,7 @@ applications: buildpack: java_buildpack # cf buildpacks 명령어로 java buildpack 이름 확인 env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 eureka_server_enable_self_preservation: true server_port: 80 TZ: Asia/Seoul diff --git a/backend/portal-service/Dockerfile b/backend/portal-service/Dockerfile index bd86ccf..1f91f39 100644 --- a/backend/portal-service/Dockerfile +++ b/backend/portal-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 @@ -11,5 +9,5 @@ WORKDIR $APP_HOME COPY build/libs/*.jar app.jar # application port #EXPOSE 8000 -# 실행 (application-cf.yml 프로필이 기본값) -CMD ["java", "-Dspring.profiles.active=${profile:cf}", "-jar", "app.jar"] +# 실행 +CMD ["java", "-Dspring.profiles.active=${profile:default}", "-jar", "app.jar"] diff --git a/backend/portal-service/manifest.yml b/backend/portal-service/manifest.yml index efd2c12..c6d749d 100644 --- a/backend/portal-service/manifest.yml +++ b/backend/portal-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-portal-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/reserve-check-service/Dockerfile b/backend/reserve-check-service/Dockerfile index bd86ccf..cb80035 100644 --- a/backend/reserve-check-service/Dockerfile +++ b/backend/reserve-check-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 diff --git a/backend/reserve-check-service/manifest.yml b/backend/reserve-check-service/manifest.yml index c9b631c..b737f5e 100644 --- a/backend/reserve-check-service/manifest.yml +++ b/backend/reserve-check-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-reserve-check-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/reserve-item-service/Dockerfile b/backend/reserve-item-service/Dockerfile index bd86ccf..cb80035 100644 --- a/backend/reserve-item-service/Dockerfile +++ b/backend/reserve-item-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 diff --git a/backend/reserve-item-service/manifest.yml b/backend/reserve-item-service/manifest.yml index c35ed8d..d41d4af 100644 --- a/backend/reserve-item-service/manifest.yml +++ b/backend/reserve-item-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-reserve-item-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/reserve-request-service/Dockerfile b/backend/reserve-request-service/Dockerfile index bd86ccf..cb80035 100644 --- a/backend/reserve-request-service/Dockerfile +++ b/backend/reserve-request-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ # 작업 시작 위치 diff --git a/backend/reserve-request-service/manifest.yml b/backend/reserve-request-service/manifest.yml index 727016c..d729e36 100644 --- a/backend/reserve-request-service/manifest.yml +++ b/backend/reserve-request-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-reserve-request-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/user-service/Dockerfile b/backend/user-service/Dockerfile index 3ef9942..b0d8366 100644 --- a/backend/user-service/Dockerfile +++ b/backend/user-service/Dockerfile @@ -1,8 +1,6 @@ # openjdk8 base image FROM openjdk:8-jre-alpine -# config server uri: dockder run --e 로 변경 가능 -#ENV SPRING_CLOUD_CONFIG_URI https://egov-config.paas-ta.org RUN mkdir -p /usr/app/msa-attach-volume # jar 파일이 복사되는 위치 ENV APP_HOME=/usr/app/ @@ -12,5 +10,5 @@ WORKDIR $APP_HOME COPY build/libs/*.jar app.jar # cf docker push, random port 사용할 수 없다 #EXPOSE 80 -# 실행 (application-cf.yml 프로필이 기본값) -CMD ["java", "-Dspring.profiles.active=${profile:cf}", "-jar", "app.jar"] +# 실행 +CMD ["java", "-Dspring.profiles.active=${profile:default}", "-jar", "app.jar"] diff --git a/backend/user-service/manifest.yml b/backend/user-service/manifest.yml index 8188fed..e2e2d14 100644 --- a/backend/user-service/manifest.yml +++ b/backend/user-service/manifest.yml @@ -10,7 +10,7 @@ applications: - egov-discovery-provided-service # discovery service binding env: spring_profiles_active: cf - spring_cloud_config_uri: https://egov-config.paas-ta.org + spring_cloud_config_uri: http://localhost:8888 app_name: egov-user-service # logstash custom app name TZ: Asia/Seoul JAVA_OPTS: -Xss349k diff --git a/backend/user-service/src/main/resources/application.yml b/backend/user-service/src/main/resources/application.yml index 6a703b2..67236a6 100644 --- a/backend/user-service/src/main/resources/application.yml +++ b/backend/user-service/src/main/resources/application.yml @@ -7,9 +7,6 @@ spring: profiles: group: default: oauth - docker: oauth - cf: oauth - k8s: oauth jpa: hibernate: ddl-auto: none @@ -37,30 +34,3 @@ management: health: mail: enabled: false - -# @TODO application-oauth.yml -# spring: -# security: -# oauth2: -# client: -# registration: -# google: -# client-id: @TODO https://console.cloud.google.com -# client-secret: @TODO -# scope: profile,email -# # 네이버는 Spring Security를 공식 지원하지 않기 때문에 CommonOAuth2Provider 에서 해주는 값들을 수동으로 입력한다. -# naver: -# client-id: @TODO https://developers.naver.com/apps/#/register?api=nvlogin -# client-secret: @TODO -# redirect_uri_template: "{baseUrl}/{action}/oauth2/code/{registrationId}" -# authorization_grant_type: authorization_code -# scope: name,email,profile_image -# client-name: Naver -# provider: -# naver: -# authorization_uri: https://nid.naver.com/oauth2.0/authorize -# token_uri: https://nid.naver.com/oauth2.0/token -# user-info-uri: https://openapi.naver.com/v1/nid/me -# # 기준이 되는 user_name 의 이름을 네이버에서는 response로 지정해야한다. (네이버 회원 조회시 반환되는 JSON 형태 때문이다) -# # response를 user_name으로 지정하고 이후 자바 코드로 response의 id를 user_name으로 지정한다. (스프링 시큐리티에서 하위 필드를 명시할 수 없기 때문) -# user_name_attribute: response diff --git a/docker-compose/app/docker-compose.yml b/docker-compose/app/docker-compose.yml new file mode 100644 index 0000000..d9b2b08 --- /dev/null +++ b/docker-compose/app/docker-compose.yml @@ -0,0 +1,41 @@ +version: '3.8' +services: + egov-user-service: + container_name: egov-user-service + image: egovframe/msa-user-service:latest + restart: always + #networks: egovnetwork + volumes: + - ${HOME}/msa-attach-volume:/usr/app/msa-attach-volume + environment: + SPRING_PROFILES_ACTIVE: default + depends_on: + - egov-apigateway + + egov-board-service: + container_name: egov-board-service + image: egovframe/msa-board-service:latest + restart: always + #networks: egovnetwork + volumes: + - ${HOME}/msa-attach-volume:/usr/app/msa-attach-volume + environment: + SPRING_PROFILES_ACTIVE: default + depends_on: + - egov-apigateway + + egov-portal-service: + container_name: egov-portal-service + image: egovframe/msa-portal-service:latest + restart: always + #networks: egovnetwork + volumes: + - ${HOME}/msa-attach-volume:/usr/app/msa-attach-volume + environment: + SPRING_PROFILES_ACTIVE: default + depends_on: + - egov-apigateway + +# networks: +# egovnetwork: +# driver: bridge \ No newline at end of file