• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

배포 에러 질문입니다.

23.01.01 17:36 작성 23.01.01 17:39 수정 조회수 450

0

최근 소스 코드 자료 (21/12/28) 다운받아서 보고있는데,

강의 목록 중에 [AWS 업데이트) 일래스틱 빈스톡 플랫폼 브랜치] 와 약간 달라서 질문드립니다.

 

Dockerrun.aws.json에 명시되어 있는 설정들을 docker-compose.yml으로 옮기는 과정에서

version: '3'

services:
  nginx:
    restart: always
    image: xxx/docker-nginx
    ports:
      - "80:80"

여기서 mem_limit과 links 부분이 다운받은 소스코드 자료에는 없는데,(version 2.4 도..)

어떤 자료가 맞는 것인지 질문드립니다..

---

그리고 travis ci는 정상적으로 동작하는데,

Elastic Beanstalk 환경에서는 상태가 '심각'으로 나옵니다..

EB에서 환경으로 이동시, 502 Bad Gateway ...

nginx_1     | 2023/01/01 07:37:50 [error] 28#28: *16 connect() failed (113: No route to host) while connecting to upstream, ....

 

frontend/Dockerfile

FROM node:16-alpine as builder
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build  /usr/share/nginx/html

frontend/nginx/default.conf

server {
    listen 3000;

    location / {

        root /usr/share/nginx/html;

        index index.html index.htm;

        try_files $uri $uri/ /index.html

    }
}

nginx/default.conf

upstream frontend {
    server frontend:3000;
}

upstream backend {
    server backend:5000;
}

server {
    listen 80;

    location / {
        proxy_pass http://frontend;
    }

    location /api {
        proxy_pass http://backend;
    }

    location /sockjs-node {
        proxy_pass http://frontend;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }
}

 

답변 부탁드립니다.

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!