👆 (M1에서) ECS 배포 오류 관련
[참고] https://appleg1226.tistory.com/35
✌️ Dockerfile, app.conf 수정
spring 컨네이너와 nginx 컨테이너를 띄우기 위해 도커 파일 작성
spring Dockerfile
FROM openjdk:11 AS builder
COPY ./intern-project/gradlew .
COPY ./intern-project/gradle gradle
COPY ./intern-project/build.gradle .
COPY ./intern-project/settings.gradle .
COPY ./intern-project/src src
RUN chmod +x ./gradlew
RUN ./gradlew bootJar
FROM openjdk:11
COPY --from=builder build/libs/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]
nginx Dockerfile
FROM nginx
RUN rm -rf /etc/nginx/conf.d/default.conf
COPY ./web/prd/nginx/conf.d/app.conf /etc/nginx/conf.d/app.conf
WORKDIR /etc/nginx
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
app.conf
server {
resolver 10.1.0.2 valid=5s;
# VPCr가 10.1.0.0/16이라면 resolver는 10.1.0.2
location / {
set $target "{nlb DNS 주소}";
proxy_pass http://$target;
proxy_set_header Host $target;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
td-dev-spring-01
, td-dev-nginx-01
, td-prd-spring-01
, td-prd-nginx-01
container-dev-spring-01
, container-dev-nginx-01
, container-prd-spring-01
, container-prd-nginx-01
ecs-dev-spring-01
, ecs-dev-nginx-01
, ecs-prd-spring-01
, ecs-prd-nginx-01
ecs-service-dev-spring-01
, ecs-service-dev-nginx-01
, ecs-service-prd-spring-01
, ecs-service-prd-nginx-01
ALBRequestCount
(WEB)AverageCPUUtilization
(WAS)