Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.idea
.vscode
.gradle
bazel-*
bazel-bin
bazel-out
bazel-testlogs
tmp
temp
logs
*.log
*.iml
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# syntax=docker/dockerfile:experimental
FROM gcr.io/bazel-public/bazel:8.5.1 AS builder

ARG SERVICE
WORKDIR /workspace

COPY . .
COPY . .
RUN bazel build //:${SERVICE}

FROM eclipse-temurin:17-jre

ARG SERVICE
WORKDIR /app

COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main /app/main
COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main.runfiles /app/main.runfiles
COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main.runfiles_manifest /app/main.runfiles_manifest

RUN chmod +x /app/main

EXPOSE 8080
ENTRYPOINT ["/app/main"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
spring:
application:
name: admin
profiles:
default: local
main:
lazy-initialization: true
server:
Expand Down
19 changes: 19 additions & 0 deletions systems/application/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Spring profile: dev or prod
SPRING_PROFILES_ACTIVE=dev

# Server
SERVER_PORT=8080

# Database
DB_USERNAME=root
DB_PASSWORD=change-me
DB_URL=jdbc:mysql://localhost:3306/application_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true

# Application schedule
# Format: yyyy-MM-ddTHH:mm:ss
APPLICATION_START_AT=2026-09-01T00:00:00
APPLICATION_END_AT=2026-10-01T00:00:00
RESULT_ANNOUNCED_AT=2026-11-01T00:00:00

# gRPC
GRPC_PORT=9090
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ spring:
activate:
on-profile: dev
datasource:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
url: ${DB_URL:jdbc:mysql://localhost:3306/application_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true}
username: ${DB_USERNAME:root}
password: ${DB_PASSWORD:password}
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
Expand All @@ -19,6 +19,12 @@ spring:
entrydsm:
application:
schedule:
application-start-at: ${APPLICATION_START_AT}
application-end-at: ${APPLICATION_END_AT}
result-announced-at: ${RESULT_ANNOUNCED_AT}
application-start-at: ${APPLICATION_START_AT:2026-09-01T00:00:00}
application-end-at: ${APPLICATION_END_AT:2026-10-01T00:00:00}
result-announced-at: ${RESULT_ANNOUNCED_AT:2026-11-01T00:00:00}

server:
port: ${SERVER_PORT:8080}

grpc:
port: ${GRPC_PORT:9090}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
spring:
application:
name: application
profiles:
default: dev
main:
lazy-initialization: true
datasource:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: validate
open-in-view: false
show-sql: false
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect

entrydsm:
application:
schedule:
application-start-at: ${APPLICATION_START_AT}
application-end-at: ${APPLICATION_END_AT}
result-announced-at: ${RESULT_ANNOUNCED_AT}

server:
port: ${SERVER_PORT}
shutdown: graceful

grpc:
port: ${GRPC_PORT:9090}
port: ${GRPC_PORT}

management:
endpoints:
Expand Down
15 changes: 15 additions & 0 deletions systems/configuration/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Spring profile: dev or prod
SPRING_PROFILES_ACTIVE=dev

# Database
DB_USERNAME=root
DB_PASSWORD=change-me
DB_URL=jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true

# S3
AWS_S3_BUCKET=entrydsm-document-local
AWS_S3_REGION=ap-northeast-2
AWS_S3_PRESIGN_EXPIRY_SECONDS=600

# gRPC
GRPC_PORT=9090
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import software.amazon.awssdk.services.s3.presigner.S3Presigner

@Configuration
class S3Config(
@Value("\${aws.s3.region:ap-northeast-2}") private val region: String,
@Value("\${aws.s3.region}") private val region: String,
) {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class DocumentBeanConfig {
fun fileDocumentService(
storagePort: StoragePort,
fileDocumentRepository: FileDocumentRepository,
@Value("\${aws.s3.presign-expiry-seconds:600}") presignExpirySeconds: Long,
@Value("\${aws.s3.presign-expiry-seconds}") presignExpirySeconds: Long,
) = FileDocumentService(storagePort, fileDocumentRepository, presignExpirySeconds)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
config:
activate:
on-profile: dev
datasource:
url: ${DB_URL:jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true}
username: ${DB_USERNAME:root}
password: ${DB_PASSWORD:password}

aws:
s3:
bucket: ${AWS_S3_BUCKET:entrydsm-document-local}
region: ${AWS_S3_REGION:ap-northeast-2}
presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS:600}

grpc:
port: ${GRPC_PORT:9090}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
spring:
application:
name: configuration
profiles:
default: local
main:
lazy-initialization: true
datasource:
url: jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: ${DB_USERNAME:root}
password: ${DB_PASSWORD:password}
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
Expand All @@ -25,20 +23,14 @@ spring:
aws:
s3:
bucket: ${AWS_S3_BUCKET}
region: ${AWS_S3_REGION:ap-northeast-2}
presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS:600}
region: ${AWS_S3_REGION}
presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS}

server:
shutdown: graceful

grpc:
port: ${GRPC_PORT:9090}

aws:
s3:
bucket: ${S3_BUCKET:entrydsm-document-local}
region: ${AWS_REGION:ap-northeast-2}
presign-expiry-seconds: ${S3_PRESIGN_EXPIRY_SECONDS:600}
port: ${GRPC_PORT}

management:
endpoints:
Expand Down
6 changes: 6 additions & 0 deletions systems/gateway/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Spring profile: dev or prod
SPRING_PROFILES_ACTIVE=dev

# Server
SERVER_PORT=8080

# Gateway downstream service endpoints
GATEWAY_SERVICES_IDENTITY=http://localhost:8081
GATEWAY_SERVICES_APPLICATION=http://localhost:8082
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
spring:
config:
activate:
on-profile: dev
data:
redis:
url: ${GATEWAY_RESILIENCE_REDIS_URI:redis://localhost:6379}
server:
port: ${SERVER_PORT:8080}
gateway:
downstream:
connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS:2000}
response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS:5000}
retries: ${GATEWAY_DOWNSTREAM_RETRIES:2}
retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS:50}
retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS:1000}
retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR:2}
retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE:false}
retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR:0.5}
services:
identity: ${GATEWAY_SERVICES_IDENTITY:http://localhost:8081}
application: ${GATEWAY_SERVICES_APPLICATION:http://localhost:8082}
admin: ${GATEWAY_SERVICES_ADMIN:http://localhost:8083}
notification: ${GATEWAY_SERVICES_NOTIFICATION:http://localhost:8084}
observability: ${GATEWAY_SERVICES_OBSERVABILITY:http://localhost:8085}
configuration: ${GATEWAY_SERVICES_CONFIGURATION:http://localhost:8086}
cors:
allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS:http://localhost:3000}
request:
max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES:10485760}
resilience:
failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD:50}
sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE:10}
minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS:5}
wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS:30}
permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE:1}
state-store: ${GATEWAY_RESILIENCE_STATE_STORE:redis}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ spring:
main:
web-application-type: reactive
lazy-initialization: false
profiles:
default: local
data:
redis:
url: ${GATEWAY_RESILIENCE_REDIS_URI:redis://localhost:6379}
url: ${GATEWAY_RESILIENCE_REDIS_URI}
cloud:
gateway:
server:
Expand All @@ -32,40 +30,40 @@ spring:
jitter:
randomFactor: ${gateway.downstream.retry-jitter-random-factor}
server:
port: 8080
port: ${SERVER_PORT}
shutdown: graceful
gateway:
downstream:
connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS:2000}
response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS:5000}
retries: ${GATEWAY_DOWNSTREAM_RETRIES:2}
connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS}
response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS}
retries: ${GATEWAY_DOWNSTREAM_RETRIES}
retry-methods: GET,HEAD,OPTIONS
retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS:50}
retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS:1000}
retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR:2}
retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE:false}
retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR:0.5}
retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS}
retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS}
retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR}
retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE}
retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR}
services:
identity: ${GATEWAY_SERVICES_IDENTITY:http://localhost:8081}
application: ${GATEWAY_SERVICES_APPLICATION:http://localhost:8082}
admin: ${GATEWAY_SERVICES_ADMIN:http://localhost:8083}
notification: ${GATEWAY_SERVICES_NOTIFICATION:http://localhost:8084}
observability: ${GATEWAY_SERVICES_OBSERVABILITY:http://localhost:8085}
configuration: ${GATEWAY_SERVICES_CONFIGURATION:http://localhost:8086}
identity: ${GATEWAY_SERVICES_IDENTITY}
application: ${GATEWAY_SERVICES_APPLICATION}
admin: ${GATEWAY_SERVICES_ADMIN}
notification: ${GATEWAY_SERVICES_NOTIFICATION}
observability: ${GATEWAY_SERVICES_OBSERVABILITY}
configuration: ${GATEWAY_SERVICES_CONFIGURATION}
cors:
allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS:http://localhost:3000}
allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS}
allowed-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
allowed-headers: Authorization,Content-Type,X-Trace-Id
max-age-seconds: 3600
request:
max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES:10485760}
max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES}
resilience:
failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD:50}
sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE:10}
minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS:5}
wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS:30}
permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE:1}
state-store: ${GATEWAY_RESILIENCE_STATE_STORE:redis}
failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD}
sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE}
minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS}
wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS}
permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE}
state-store: ${GATEWAY_RESILIENCE_STATE_STORE}
management:
endpoints:
web:
Expand Down
Loading
Loading