diff --git a/.github/workflows/aws-cicd.yml b/.github/workflows/aws-cicd.yml index 3276bf00..db93bb1b 100644 --- a/.github/workflows/aws-cicd.yml +++ b/.github/workflows/aws-cicd.yml @@ -25,7 +25,7 @@ jobs: if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then echo "DEPLOY_TARGET=production" >> $GITHUB_OUTPUT else - echo "DEPLOY_TARGET=aws" >> $GITHUB_OUTPUT + echo "DEPLOY_TARGET=dev" >> $GITHUB_OUTPUT fi build: diff --git a/layer-api/infra/development/docker-compose.yaml b/layer-api/infra/development/docker-compose.yaml index 5d664994..ff32dc53 100644 --- a/layer-api/infra/development/docker-compose.yaml +++ b/layer-api/infra/development/docker-compose.yaml @@ -1,12 +1,12 @@ services: java-app: - image: ghcr.io/depromeet/kasukabe-server/layer-api:latest + image: docker.io/clean01/layer-server_layer-api:latest container_name: layer-api ports: - "8080:8080" environment: - TZ=Asia/Seoul - - SPRING_PROFILES_ACTIVE=dev +# - SPRING_PROFILES_ACTIVE=aws volumes: - ./application-secret.properties:/config/application-secret.properties - ./log:/log @@ -14,6 +14,21 @@ services: networks: - app-network +# batch-job: +# image: docker.io/clean01/layer-server_layer-batch:latest +# container_name: layer-batch +# environment: +# - TZ=Asia/Seoul +# volumes: +# - ./application-secret.properties:/config/application-secret.properties +# - ./log:/log +# - ./tokens:/config/tokens +# networks: +# - app-network +# depends_on: +# - java-app +# restart: always + nginx: image: nginx:latest container_name: nginx @@ -28,4 +43,3 @@ services: networks: app-network: - driver: bridge diff --git a/layer-api/infra/development/tokens/StoredCredential b/layer-api/infra/development/tokens/StoredCredential new file mode 100644 index 00000000..63b1c6c1 Binary files /dev/null and b/layer-api/infra/development/tokens/StoredCredential differ diff --git a/layer-api/src/main/resources/application-aws.yml b/layer-api/src/main/resources/application-aws.yml index 6aeb6cef..ace193ec 100644 --- a/layer-api/src/main/resources/application-aws.yml +++ b/layer-api/src/main/resources/application-aws.yml @@ -8,7 +8,7 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: - ddl-auto: create + ddl-auto: update properties: hibernate: format_sql: true @@ -18,12 +18,12 @@ spring: data: redis: - host: ${PROD_REDIS_HOST} - port: ${PROD_REDIS_PORT} - password: ${PROD_REDIS_PASSWORD} + host: ${DEV_REDIS_HOST} + port: ${DEV_REDIS_PORT} + password: ${DEV_REDIS_PASSWORD} jwt: - secret: ${PROD_JWT_SECRET} + secret: ${DEV_JWT_SECRET} kakao: login: @@ -41,12 +41,15 @@ kakao: google: login: client_id: ${DEV_GOOGLE_CLIENT_ID} + code_uri: ${DEV_GOOGLE_CODE_URI} + token_uri: ${DEV_GOOGLE_TOKEN_URI} client_secret: ${DEV_GOOGLE_CLIENT_SECRET} redirect_uri: ${DEV_GOOGLE_REDIRECT_URI} + code_redirect_uri: http://localhost:8080/api/auth/oauth2/google/code sheet: id: ${GOOGLE_SHEET_ID} - token_path: optional:file:/config/tokens - credential_path: optional:file:/config/tokens/StoredCredentials + token_path: ${PROD_GOOGLE_TOKEN_PATH} + credential_path: ${PROD_GOOGLE_CREDENTIAL_PATH} apple: login: diff --git a/layer-api/src/main/resources/application-dev.yml b/layer-api/src/main/resources/application-dev.yml index 82e2714c..ace193ec 100644 --- a/layer-api/src/main/resources/application-dev.yml +++ b/layer-api/src/main/resources/application-dev.yml @@ -1,10 +1,10 @@ spring: config: - import: optional:file:/config/application-secret.properties + import: application-secret.properties datasource: - url: ${DEV_DB_URL} - username: ${DEV_DB_NAME} - password: ${DEV_DB_PASSWORD} + url: ${AWS_PROD_DB_URL} + username: ${AWS_PROD_DB_NAME} + password: ${AWS_PROD_DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: diff --git a/layer-api/src/main/resources/application-local.yml b/layer-api/src/main/resources/application-local.yml index c8fe1029..ace193ec 100644 --- a/layer-api/src/main/resources/application-local.yml +++ b/layer-api/src/main/resources/application-local.yml @@ -2,30 +2,25 @@ spring: config: import: application-secret.properties datasource: - driver-class-name: org.h2.Driver - url: jdbc:h2:mem:layer-local-db;DATABASE_TO_UPPER=FALSE;mode=mysql # H2 접속 정보 (전부 소문자로 지정) - username: sa - password: - h2: - console: - enabled: true - path: /h2-console + url: ${AWS_PROD_DB_URL} + username: ${AWS_PROD_DB_NAME} + password: ${AWS_PROD_DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver jpa: - database-platform: org.hibernate.dialect.H2Dialect hibernate: - ddl-auto: create + ddl-auto: update properties: hibernate: format_sql: true show_sql: true open-in-view: false - defer-datasource-initialization: true + database: mysql data: redis: - host: localhost - port: 6379 - password: + host: ${DEV_REDIS_HOST} + port: ${DEV_REDIS_PORT} + password: ${DEV_REDIS_PASSWORD} jwt: secret: ${DEV_JWT_SECRET} @@ -33,7 +28,7 @@ jwt: kakao: login: api_key: ${DEV_KAKAO_API_KEY} - redirect_uri: http://localhost:8080/api/auth/oauth2/kakao + redirect_uri: ${DEV_KAKAO_REDIRECT_URI} uri: base: https://kauth.kakao.com code: /oauth/authorize @@ -53,7 +48,7 @@ google: code_redirect_uri: http://localhost:8080/api/auth/oauth2/google/code sheet: id: ${GOOGLE_SHEET_ID} - token_path: ${LOCAL_GOOGLE_TOKEN_PATH} + token_path: ${PROD_GOOGLE_TOKEN_PATH} credential_path: ${PROD_GOOGLE_CREDENTIAL_PATH} apple: diff --git a/layer-api/src/main/resources/application.yml b/layer-api/src/main/resources/application.yml index 6aeb6cef..ef46c2ad 100644 --- a/layer-api/src/main/resources/application.yml +++ b/layer-api/src/main/resources/application.yml @@ -1,80 +1,3 @@ spring: - config: - import: application-secret.properties - datasource: - url: ${AWS_PROD_DB_URL} - username: ${AWS_PROD_DB_NAME} - password: ${AWS_PROD_DB_PASSWORD} - driver-class-name: com.mysql.cj.jdbc.Driver - jpa: - hibernate: - ddl-auto: create - properties: - hibernate: - format_sql: true - show_sql: true - open-in-view: false - database: mysql - - data: - redis: - host: ${PROD_REDIS_HOST} - port: ${PROD_REDIS_PORT} - password: ${PROD_REDIS_PASSWORD} - -jwt: - secret: ${PROD_JWT_SECRET} - -kakao: - login: - api_key: ${DEV_KAKAO_API_KEY} - redirect_uri: ${DEV_KAKAO_REDIRECT_URI} - uri: - base: https://kauth.kakao.com - code: /oauth/authorize - token: /oauth/token - api: - uri: - base: https://kapi.kakao.com - user: /v2/user/me - -google: - login: - client_id: ${DEV_GOOGLE_CLIENT_ID} - client_secret: ${DEV_GOOGLE_CLIENT_SECRET} - redirect_uri: ${DEV_GOOGLE_REDIRECT_URI} - sheet: - id: ${GOOGLE_SHEET_ID} - token_path: optional:file:/config/tokens - credential_path: optional:file:/config/tokens/StoredCredentials - -apple: - login: - issuer: ${DEV_APPLE_ISSUER} - client_id: ${DEV_APPLE_CLIENT_ID} - audience: ${DEV_APPLE_AUD} - -webmvc: - cors: - allowedOrigins: - http://localhost:8080, - https://api.layerapp.io, - https://layerapp.io, - http://localhost:5173 - -ncp: - storage: - region: ${STORAGE_REGION} - bucketName: ${STORAGE_NAME} - endpoint: ${STORAGE_ENDPOINT} - accessKey: ${STORAGE_ACCESS_KEY} - secretKey: ${STORAGE_SECRET_KEY} - -openai: - systemContent: ${OPENAI_SYSTEM_CONTENT} - apiKey: ${OPENAI_API_KEY} - model: ${OPENAI_MODEL} - maxTokens: ${OPENAI_MAX_TOKENS} - -admin: - password: ${ADMIN_PASSWORD} \ No newline at end of file + profiles: + active: local \ No newline at end of file