-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from KCY-Fit-a-Pet/feat/8
✨ PR 하나로 Issue 도장깨기
- Loading branch information
Showing
87 changed files
with
3,747 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM openjdk:17 | ||
ARG JAR_FILE=build/libs/*.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","/app.jar","--spring.profiles.active=prod","-Duser.timezone=Asia/Seoul"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3.7' | ||
services: | ||
proxy: | ||
image: jaeseo/nginx:latest | ||
restart: always | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
networks: | ||
- was-net | ||
depends_on: | ||
- api | ||
|
||
fitapet-api: | ||
image: jaeseo/fitapet:latest | ||
restart: unless-stopped | ||
ports: | ||
- "8080:8080" | ||
env_file: | ||
- .env | ||
networks: | ||
- was-net | ||
|
||
networks: | ||
was-net: | ||
name: fitapet | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM nginx | ||
|
||
ADD nginx.conf /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
user nginx; | ||
worker_processes auto; | ||
error_log /var/log/nginx/error.log; | ||
pid /var/run/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; # 옵션 항목을 설정해둔 파일의 경로 | ||
default_type application/octet-stream; # 옥텟 스트림 기반의 http를 사용 | ||
|
||
# 백엔드 upstream 설정 (nginx가 downstream) | ||
upstream docker-server { | ||
server fitapet-api:8080; # nginx가 요청을 전달할 서버를 정의하는 지시자 (여기서는 WAS, 웹 어플리케이션 서버 host주소:포트) | ||
} | ||
|
||
server { | ||
listen 80; # 서버가 리스닝할 포트를 설정하는 지시자 (server 블록 하나 당 하나의 웹 사이트 선언) | ||
listen [::]:80; | ||
|
||
server_name localhost; # 서버의 도메인 이름을 설정하는 지시자 (request header의 host와 비교하여 일치하는 경우에만 처리) | ||
|
||
location / { | ||
root /usr/share/nginx/html; # root 지시자는 요청이 들어왔을 때, 해당 요청을 처리할 파일의 기본 경로를 설정 | ||
index index.html index.htm; # index 지시자는 root 지시자에서 설정한 경로에서 찾을 파일의 이름을 설정 | ||
try_files $uri $uri/ /index.html =404; # try_files 지시자는 파일을 찾을 수 없는 경우의 처리 방법을 설정 | ||
} | ||
|
||
location /api { | ||
proxy_pass http://docker-server; # proxy_pass 지시자는 요청을 전달할 서버의 주소를 설정 | ||
proxy_redirect off; # proxy_redirect 지시자는 리다이렉션을 설정 | ||
proxy_set_header Host $host; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
proxy_set_header X-Forwarded-Proto $scheme; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
} | ||
|
||
# location /socket { | ||
# proxy_pass http://docker-server; | ||
# proxy_http_version 1.1; # proxy_http_version 지시자는 HTTP 버전을 설정 | ||
# proxy_set_header Upgrade $http_upgrade; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
# proxy_set_header Connection "upgrade"; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
# proxy_set_header Host $host; # proxy_set_header 지시자는 요청 헤더의 값을 변경 | ||
# } | ||
} | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; # log_format 지시자는 로그의 형식을 설정 | ||
access_log /var/log/nginx/access.log main; # access_log 지시자는 로그 파일의 경로와 형식을 설정 | ||
|
||
sendfile on; # sendfile 지시자는 파일 전송 방식을 설정 | ||
server_tokens off; # server_tokens 지시자는 응답 헤더의 Server 값을 설정 | ||
keepalive_timeout 65; # keepalive_timeout 지시자는 keep-alive 연결의 타임아웃 시간을 설정 | ||
include /etc/nginx/conf.d/*.conf; # include 지시자는 외부 설정 파일을 포함 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/com/kcy/fitapet/domain/care/domain/Care.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.kcy.fitapet.domain.care.domain; | ||
|
||
import com.kcy.fitapet.domain.member.domain.Member; | ||
import com.kcy.fitapet.domain.model.Auditable; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "CARE") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@ToString(of = {"careName", "dtype"}) | ||
public class Care extends Auditable { | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Column(name = "care_name") | ||
private String careName; | ||
@Column(name = "dtype") | ||
@Convert(converter = CareTypeConverter.class) | ||
private CareType dtype; | ||
|
||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "author_id", updatable = false) | ||
private Member author; | ||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "last_editor_id") | ||
private Member lastEditor; | ||
@OneToMany(mappedBy = "care", cascade = CascadeType.ALL) | ||
private List<CareDetail> careDetails = new ArrayList<>(); | ||
|
||
@Builder | ||
private Care(String careName, CareType dtype) { | ||
this.careName = careName; | ||
this.dtype = dtype; | ||
} | ||
|
||
public static Care of(String careName, CareType dtype) { | ||
return Care.builder() | ||
.careName(careName) | ||
.dtype(dtype) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.