Skip to content

Commit 3cdcb0e

Browse files
committed
DevOps 수정
1 parent fdcd384 commit 3cdcb0e

File tree

11 files changed

+60
-62
lines changed

11 files changed

+60
-62
lines changed

.github/workflows/deploy-frontend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Node.js # Node.js 설정 추가
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: '16'
22+
node-version: '18'
2323

2424
- name: Check SERVER_IP
2525
run: echo "SERVER_IP = ${{ secrets.SERVER_IP }}"

DevOps/.env.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SSL_CERT_PATH=/etc/letsencrypt/live/tukcbu.com/fullchain.pem
2+
SSL_KEY_PATH=/etc/letsencrypt/live/tukcbu.com/privkey.pem

DevOps/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# 환경변수 파일
2-
.env.*
32
config/*
43

54
# nginx 빌드 후 파일

DevOps/docker-compose.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
version: "3.8"
22

33
services:
4+
frontend:
5+
build: ../frontend
6+
container_name: frontend
7+
expose:
8+
- "80"
9+
410
backend:
511
build: ../backend
612
container_name: backend
7-
image: souljump/cbumanage
8-
expose:
9-
- "8080"
13+
ports:
14+
- "8080:8080"
1015
env_file:
1116
- .env.dev
1217
volumes:
@@ -15,26 +20,28 @@ services:
1520
depends_on:
1621
- redis
1722

23+
redis:
24+
image: redis:latest
25+
container_name: redis
26+
networks:
27+
- cbu-net
28+
1829
nginx:
1930
build:
20-
context: ../
21-
dockerfile: DevOps/nginx/Dockerfile
31+
context: ./nginx
32+
dockerfile: Dockerfile
2233
container_name: nginx
2334
ports:
2435
- "443:443"
2536
- "80:80"
2637
env_file:
27-
- .env.dev # dev 서버
38+
- .env.dev
2839
depends_on:
40+
- frontend
2941
- backend
3042
volumes:
3143
- /etc/letsencrypt:/etc/letsencrypt:ro
3244

33-
redis:
34-
image: redis:latest
35-
container_name: redis
36-
networks:
37-
- cbu-net
3845
networks:
3946
cbu-net:
4047
driver: bridge

DevOps/nginx/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
FROM nginx:stable-alpine
2-
32
WORKDIR /etc/nginx
43

5-
# SSL 인증서 복사
6-
COPY ssl /etc/nginx/ssl
7-
8-
# 설정파일 복사
94
COPY default.conf.template /etc/nginx/conf.d/default.conf.template
105

116
CMD ["/bin/sh", "-c", "envsubst '$$SSL_CERT_PATH $$SSL_KEY_PATH' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"]

DevOps/nginx/default.conf

Lines changed: 0 additions & 25 deletions
This file was deleted.

DevOps/nginx/default.conf.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ server {
55
ssl_certificate ${SSL_CERT_PATH};
66
ssl_certificate_key ${SSL_KEY_PATH};
77

8-
location /api/ {
9-
proxy_pass http://backend:8080;
8+
location /api/v1/ {
9+
proxy_pass http://backend:8080/api/v1;
1010
proxy_set_header Host $host;
1111
proxy_set_header X-Real-IP $remote_addr;
1212
}
1313

1414
location / {
15-
root /usr/share/nginx/html;
16-
index index.html;
17-
try_files $uri $uri/ /index.html;
15+
proxy_pass http://frontend:80;
16+
proxy_set_header Host $host;
17+
proxy_set_header X-Real-IP $remote_addr;
1818
}
1919
}
2020

2121
server {
2222
listen 80;
2323
server_name tukcbu.com www.tukcbu.com;
2424
return 301 https://$host$request_uri;
25-
}
25+
}

backend/.DS_Store

0 Bytes
Binary file not shown.

backend/Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
FROM openjdk:17
2-
WORKDIR /backend
1+
FROM eclipse-temurin:17-jdk AS build
32

4-
COPY build/libs/cbuManage-0.0.1-SNAPSHOT.jar app.jar
3+
WORKDIR /app
54

6-
EXPOSE 8080
7-
ENTRYPOINT ["java", "-jar", "app.jar"]
5+
# Gradle wrapper 복사
6+
COPY gradlew .
7+
COPY gradle gradle
8+
9+
# 소스 복사
10+
COPY build.gradle .
11+
COPY settings.gradle .
12+
COPY src src
13+
14+
# 🔥 반드시 clean 포함해서 빌드
15+
RUN ./gradlew clean build -x test --no-daemon
16+
17+
# -----------------------------------
18+
FROM eclipse-temurin:17-jre
819

20+
WORKDIR /app
21+
22+
COPY --from=build /app/build/libs/*.jar app.jar
23+
24+
ENTRYPOINT ["java", "-jar", "app.jar"]

backend/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies {
4242
annotationProcessor 'org.projectlombok:lombok'
4343
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4444
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
45-
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '3.0.5'
45+
implementation 'org.springframework.boot:spring-boot-starter-mail'
4646
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
4747
implementation 'com.google.api-client:google-api-client:1.34.0'
4848
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.0'
@@ -51,7 +51,6 @@ dependencies {
5151
implementation 'com.google.auth:google-auth-library-oauth2-http:1.22.0'
5252
implementation 'javax.annotation:javax.annotation-api:1.3.2'
5353

54-
5554
}
5655

5756
tasks.named('test') {

0 commit comments

Comments
 (0)