-
Notifications
You must be signed in to change notification settings - Fork 0
merge to main #85
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
merge to main #85
Changes from all commits
4639441
61975e9
2c96e67
9d4fa35
96eddf5
98c3b0f
ddb8879
9067a64
1333671
1ff16e0
539801f
27fb45e
491d144
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| FROM eclipse-temurin:17-jdk | ||
| WORKDIR /app | ||
| # (중요) cgroup 리소스 감지 비활성화 | ||
| ENV JAVA_TOOL_OPTIONS="-XX:-UseContainerSupport" | ||
|
|
||
|
|
@@ -8,7 +9,12 @@ ENV SPRING_AUTOCONFIGURE_EXCLUDE="org.springframework.boot.actuate.autoconfigure | |
| # (중요) ProcessorMetrics 바인더 비활성화 | ||
| ENV MANAGEMENT_METRICS_BINDERS_PROCESSOR_ENABLED="false" | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| EXPOSE 80 | ||
| ARG JAR_FILE=/build/libs/*.jar | ||
| ARG JAR_FILE=build/libs/*.jar | ||
| ARG PROFILES | ||
| ARG ENV | ||
|
Comment on lines
+16
to
+17
Contributor
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. |
||
| COPY ${JAR_FILE} app.jar | ||
| ENTRYPOINT ["java","-jar","-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=prod","/app.jar"] | ||
|
|
||
| ENTRYPOINT ["java","-jar","-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=prod","/app/app.jar"] | ||
|
Contributor
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.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,38 @@ | ||
| server { | ||
| listen 80; | ||
| listen [::]:80; | ||
| upstream blue { | ||
| server blue:8080; | ||
| } | ||
|
|
||
| upstream green { | ||
| server green:8080; | ||
| } | ||
|
|
||
| location / { | ||
| proxy_set_header Host $host; | ||
| proxy_pass http://backend:8080/; | ||
| proxy_read_timeout 90; | ||
| server { | ||
| listen 80; | ||
| listen [::]:80; | ||
|
|
||
| include /etc/nginx/conf.d/service-env.inc; | ||
|
|
||
| ## try_files $uri $uri/ =404; | ||
| location = /env { | ||
| default_type text/plain; | ||
| return 200 "service_url"; | ||
|
Contributor
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. |
||
| } | ||
| } | ||
|
|
||
| location / { | ||
| proxy_pass http://$service_url; | ||
|
|
||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header Host $http_host; | ||
|
|
||
| root /usr/share/nginx/html; | ||
| index index.html index.htm; | ||
| } | ||
|
|
||
| error_page 500 502 503 504 /50x.html; | ||
| location = /50x.html { | ||
| root /usr/share/nginx/html; | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| blue: | ||
| image: nokmaster/backend | ||
| container_name: blue | ||
| ports: | ||
| - "8080:8080" | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| - PROFILES=blue | ||
| - ENV=blue | ||
| networks: | ||
| - nok-network | ||
|
|
||
| networks: | ||
| nok-network: | ||
| external: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| green: | ||
| image: nokmaster/backend | ||
| container_name: green | ||
| ports: | ||
| - "8081:8080" | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| - PROFILES=green | ||
| - ENV=green | ||
| networks: | ||
| - nok-network | ||
|
|
||
| networks: | ||
| nok-network: | ||
| external: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,16 @@ | ||
| version: "3" | ||
|
|
||
| version: '3.8' | ||
| services: | ||
| backend: | ||
| image: nokmaster/backend | ||
| container_name: backend | ||
| hostname: backend | ||
| env_file: | ||
| - .env | ||
| expose: | ||
| - "8080" | ||
|
|
||
| nginx: | ||
| image: nokmaster/nginx | ||
| depends_on: | ||
| - backend | ||
| container_name: nginx | ||
| restart: always | ||
| ports: | ||
| - "80:80" | ||
| - "80:80" | ||
| volumes: | ||
| - ./nginx/conf.d:/etc/nginx/conf.d | ||
| networks: | ||
| - nok-network | ||
|
|
||
| networks: | ||
| nok-network: | ||
| name: nok-network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WORKDIR /app명령어가 2번 라인에서 이미 선언되었습니다. 중복된 선언이므로 이 라인들과 이어지는 빈 줄은 삭제하는 것이 좋습니다. 코드 가독성과 유지보수성을 높일 수 있습니다.