Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
clean2001 committed Oct 27, 2024
1 parent d1b9bca commit 60b420a
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 17 additions & 3 deletions layer-api/infra/development/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
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
- ./tokens:/config/tokens
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
Expand All @@ -28,4 +43,3 @@ services:

networks:
app-network:
driver: bridge
Binary file not shown.
17 changes: 10 additions & 7 deletions layer-api/src/main/resources/application-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions layer-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
27 changes: 11 additions & 16 deletions layer-api/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,33 @@ 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}

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
Expand All @@ -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:
Expand Down
81 changes: 2 additions & 79 deletions layer-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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}
profiles:
active: local

0 comments on commit 60b420a

Please sign in to comment.