Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Database Configuration
DB_HOST=
DB_PORT=
DB_NAME=
DB_USERNAME=
DB_PASSWORD=

# Spring Profile
SPRING_PROFILES_ACTIVE=

# OAuth - Kakao
KAKAO_CLIENT_ID=
KAKAO_CLIENT_SECRET=
KAKAO_REDIRECT_URI=
KAKAO_NATIVE_CLIENT_ID=

# OAuth - Google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=
GOOGLE_AOD_CLIENT_ID=

# JWT
JWT_ISSUER=
JWT_SECRET=
JWT_ACCESS_EXPIRATION=
JWT_REFRESH_EXPIRATION=

# AWS S3 Configuration
AWS_S3_BUCKET_NAME=
AWS_S3_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_CLOUDFRONT_DOMAIN=
RESIZE_SECRET_KEY=

# Public Data Service Key
K_CULTURAL_INFO_CENTER_KEY=

# FCM
FIREBASE_CONFIG_PATH=
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ out/
/db
!/resources/db/*.sql
mongodb
/src/main/resources/application.yml
/src/main/resources/application-dev.yml
/src/main/resources/application-stage.yml
/src/main/resources/application-prod.yml

.DS_Store
elasticsearch/
.cursorrules
application-stageing.yml
application-stage.yml
application-production.yml
application-prod.yml
application-local.yml
!/docker/elasticsearch
/src/main/resources/firebase/

Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'io.github.resilience4j:resilience4j-spring-boot3:2.2.0'
implementation 'io.github.resilience4j:resilience4j-reactor:2.2.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
implementation 'io.github.cdimascio:java-dotenv:5.2.2'

implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'

Expand Down
80 changes: 0 additions & 80 deletions docker-compose.override.yml

This file was deleted.

50 changes: 0 additions & 50 deletions docker-compose.prod.yml

This file was deleted.

51 changes: 0 additions & 51 deletions docker-compose.stage.yml

This file was deleted.

51 changes: 47 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@
version: "3.8"

services:
app:
build:
context: .
dockerfile: docker/Dockerfile
db:
image: mysql:8.4
container_name: db
platform: linux/amd64
environment:
MYSQL_USER: artrip
MYSQL_ROOT_PASSWORD: artrip1!
MYSQL_DATABASE: artrip
MYSQL_PASSWORD: artrip1!
ports:
- "33069:3306"
volumes:
- ./db/data:/var/lib/mysql
- ./db/conf:/etc/mysql/conf.d

redis:
image: redis:7.2
container_name: redis
restart: always
ports:
- "63799:6379"
volumes:
- redis-data:/data

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: elastic
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- ES_JAVA_OPTS=-Xms1g -Xmx1g
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./elasticsearch/data:/usr/share/elasticsearch/data
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9200/_cluster/health" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
Comment on lines +28 to +46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ElasticSearch를 사용하는 기능을 대체하면 이 부분은 지우면 될 것 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 한번에 다 수정하기에는 양이 많아서 나눠서 진행 하겠습니다.



volumes:
redis-data:
9 changes: 0 additions & 9 deletions docker/elasticsearch/Dockerfile

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/java/org/atdev/artrip/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,5 @@ public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public CommandLineRunner testDb(DataSource dataSource) {
return args -> {
System.out.println("DB 연결 체크 시작");
try (var conn = dataSource.getConnection()) {
System.out.println("DB 연결 성공!");
System.out.println("JDBC URL: " + conn.getMetaData().getURL());
System.out.println("DB 제품: " + conn.getMetaData().getDatabaseProductName());
System.out.println("DB 버전: " + conn.getMetaData().getDatabaseProductVersion());
System.out.println("DB 사용자: " + conn.getMetaData().getUserName());
} catch (Exception e) {
System.err.println("DB 연결 실패!");
e.printStackTrace();
}
};
}

@Bean
public CommandLineRunner testRedis(StringRedisTemplate jwtRedisTemplate) {
return args -> {
System.out.println("Redis 연결 체크");

try {
jwtRedisTemplate.opsForValue().set("testKey", "greeting");

String value = jwtRedisTemplate.opsForValue().get("testKey");
System.out.println("Redis 연결 성공 : " + value);
} catch (Exception e) {
System.err.println("Redis 연결 실패");
e.printStackTrace();
}

};
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
@Configuration
public class ElasticsearchConfig {

@Value("${spring.elasticsearch.uris}")
private String elasticsearchUris;

@Bean
public RestClient restClient() {
return RestClient.builder(HttpHost.create(elasticsearchUris)).build();
return RestClient.builder(new HttpHost("localhost", 9200)).build();
}

@Bean
Expand Down
Loading