Skip to content

Commit 7ed631f

Browse files
committed
프로젝트 기본 Spring init 및 기본 workflow 구현 필요 : feat : dockerFile 추가 cicd yml 파일 디렉토리 환경 변수 분리 #2
1 parent 888c162 commit 7ed631f

File tree

4 files changed

+63
-6
lines changed

4 files changed

+63
-6
lines changed

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# IDE
6+
.idea
7+
*.iml
8+
.vscode
9+
10+
# Build (JAR만 필요)
11+
*/build/
12+
!MS-Web/build/libs/app.jar
13+
*/bin/
14+
*/out/
15+
16+
# Gradle
17+
.gradle
18+
gradle/wrapper/*.jar
19+
20+
# Logs & Temp
21+
*.log
22+
logs/
23+
*.tmp
24+
*.swp
25+
26+
# OS
27+
.DS_Store
28+
Thumbs.db

.github/workflows/PROJECT-SPRING-SYNOLOGY-MAPSEE-CICD.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ env:
9696
JAVA_VERSION: "21"
9797
GRADLE_OPTS: "-Dspring.profiles.active=prod"
9898

99+
# 📁 경로 설정
100+
APPLICATION_YML_DIR: "MS-Web/src/main/resources"
101+
99102
jobs:
100103
# ===================================================================
101104
# 빌드 작업
@@ -123,18 +126,18 @@ jobs:
123126

124127
# 4. Spring Boot 운영 환경 설정 파일 생성
125128
# GitHub Secrets에서 APPLICATION_PROD_YML 값을 읽어와서
126-
# src/main/resources/application-prod.yml 파일로 생성
129+
# 리소스 디렉토리에 파일로 생성
127130
- name: application-prod.yml 생성
128131
run: |
129-
# 리소스 디렉토리 생성 (프로젝트 구조에 따라 경로 조정 필요)
130-
mkdir -p src/main/resources
132+
# 리소스 디렉토리 생성 (환경변수 사용)
133+
mkdir -p ${{ env.APPLICATION_YML_DIR }}
131134
132135
# GitHub Secrets의 APPLICATION_PROD_YML 내용을 파일로 저장
133-
cat << 'EOF' > ./src/main/resources/application-prod.yml
136+
cat << 'EOF' > ./${{ env.APPLICATION_YML_DIR }}/application-prod.yml
134137
${{ secrets.APPLICATION_PROD_YML }}
135138
EOF
136139
137-
echo "✅ application-prod.yml 파일 생성 완료"
140+
echo "✅ application-prod.yml 파일 생성 완료 (${{ env.APPLICATION_YML_DIR }})"
138141
139142
# 5. Gradle 빌드 실행
140143
# 테스트는 제외하고 운영 프로파일로 빌드

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# ===================================================================
2+
# MapSee-BE Spring Boot Dockerfile
3+
# ===================================================================
4+
FROM eclipse-temurin:21-jre-alpine
5+
6+
LABEL maintainer="MapSee Team"
7+
LABEL description="MapSee Backend API Server"
8+
9+
WORKDIR /app
10+
11+
# 타임존 설정
12+
ENV TZ=Asia/Seoul
13+
RUN apk add --no-cache tzdata && \
14+
cp /usr/share/zoneinfo/$TZ /etc/localtime && \
15+
echo $TZ > /etc/timezone
16+
17+
# JAR 파일 복사 (MS-Web 모듈)
18+
COPY MS-Web/build/libs/app.jar app.jar
19+
20+
# Health check
21+
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
22+
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
23+
24+
EXPOSE 8080
25+
26+
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]

version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
version: "0.0.3"
3838
version_code: 4 # app build number
39-
project_type: "basic" # spring, flutter, next, react, react-native, react-native-expo, node, python, basic
39+
project_type: "spring" # spring, flutter, next, react, react-native, react-native-expo, node, python, basic
4040
metadata:
4141
last_updated: "2026-01-13 15:27:27"
4242
last_updated_by: "Cassiiopeia"

0 commit comments

Comments
 (0)