-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] AWS->GCP 코드 마이그레이션 #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
82b8616
8ae5954
b7d897e
f3724eb
6cd9445
83f56f5
f20db10
b600f13
5a2761a
dc03fbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| FROM eclipse-temurin:21-jre-alpine | ||
| WORKDIR /app | ||
| RUN addgroup -S app && adduser -S -G app app | ||
| COPY --chown=app:app build/libs/app.jar app.jar | ||
| EXPOSE 8080 | ||
| USER app | ||
| ENTRYPOINT ["java", "-jar", "app.jar"] | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,14 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| localstack: | ||
| image: localstack/localstack:latest | ||
| container_name: proovy-localstack | ||
| # GCS 로컬 에뮬레이터 (fake-gcs-server) | ||
| # 접속: http://localhost:4443/storage/v1/ | ||
| fake-gcs: | ||
| image: fsouza/fake-gcs-server:latest | ||
| container_name: proovy-fake-gcs | ||
| ports: | ||
| - "4566:4566" | ||
| environment: | ||
| - SERVICES=s3 | ||
| - DEBUG=1 | ||
| - TMPDIR=/var/lib/localstack/tmp | ||
| volumes: | ||
| - "./localstack-data:/var/lib/localstack" | ||
| - "/var/run/docker.sock:/var/run/docker.sock" | ||
| - "4443:4443" | ||
| command: -scheme http -port 4443 -public-host localhost:4443 | ||
|
Comment on lines
+4
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 로컬 개발 환경에서 fake-gcs-server에 연결할 수 없습니다.
현재 상태로는 로컬에서 Spring 애플리케이션이 실제 GCS에 연결을 시도하게 됩니다. 🛠️ 로컬 환경 지원을 위한 수정 제안
gcs:
project-id: ${GCS_PROJECT_ID}
bucket: ${GCS_BUCKET:proovy-assets-dev}
credentials-json: ${GCS_CREDENTIALS_JSON:}
endpoint: ${GCS_ENDPOINT:} # 로컬: http://localhost:4443
+ `@Value`("${gcs.endpoint:}")
+ private String endpoint;
`@Bean`
public Storage gcsStorage() throws IOException {
StorageOptions.Builder builder = StorageOptions.newBuilder()
.setProjectId(projectId);
+ if (endpoint != null && !endpoint.isBlank()) {
+ builder.setHost(endpoint);
+ }
if (credentialsJson != null && !credentialsJson.isBlank()) {
// ...
}
return builder.build().getService();
}
🤖 Prompt for AI Agents |
||
|
|
||
| postgres: | ||
| image: pgvector/pgvector:pg15 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.proovy.global.config; | ||
|
|
||
| import com.google.auth.oauth2.ServiceAccountCredentials; | ||
| import com.google.cloud.storage.Storage; | ||
| import com.google.cloud.storage.StorageOptions; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| import java.io.ByteArrayInputStream; | ||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
|
|
||
| @Configuration | ||
| public class GcsConfig { | ||
|
|
||
| @Value("${gcs.project-id}") | ||
| private String projectId; | ||
|
|
||
| @Value("${gcs.credentials-json:}") | ||
| private String credentialsJson; | ||
|
|
||
| @Value("${gcs.endpoint:}") | ||
| private String endpoint; | ||
|
|
||
| @Bean | ||
| public Storage gcsStorage() throws IOException { | ||
| StorageOptions.Builder builder = StorageOptions.newBuilder() | ||
| .setProjectId(projectId); | ||
|
|
||
| if (credentialsJson != null && !credentialsJson.isBlank()) { | ||
| ServiceAccountCredentials credentials = ServiceAccountCredentials | ||
| .fromStream(new ByteArrayInputStream( | ||
| credentialsJson.getBytes(StandardCharsets.UTF_8))); | ||
| builder.setCredentials(credentials); | ||
| } | ||
| // credentialsJson 미설정 시 ADC(Application Default Credentials) 사용 | ||
| // Cloud Run에서는 서비스 계정이 자동 적용됨 | ||
|
|
||
| if (endpoint != null && !endpoint.isBlank()) { | ||
| builder.setHost(endpoint); | ||
| } | ||
|
|
||
| return builder.build().getService(); | ||
| } | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.