Search

AWS 프론트 배포시 생기는 오류

태그

Description

# front 설정 파일들이 있는 디렉토리로 이동 ubuntu@ip-172-31-43-157:~$ cd /home/ubuntu/byl/frontend # 구성했던 환경 실행 ubuntu@ip-172-31-43-157:~/byl/frontend$ sudo docker-compose up -d byl-front is up-to-date # docker 컨테이너 목록 확인 ubuntu@ip-172-31-43-157:~/byl/frontend$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8103af1ed4b7 nginx:latest "/docker-entrypoint.…" 12 hours ago Up 12 hours 0.0.0.0:80->80/tcp, :::80->80/tcp byl-front f3bce6166ac4 byl/byl-backend:latest "java -jar /app.jar …" 22 hours ago Up 52 seconds 0.0.0.0:7777->7777/tcp, :::7777->7777/tcp BYL-server # front 컨테이너 ID인 byl-front logs 확인 ubuntu@ip-172-31-43-157:~/byl/frontend$ sudo docker logs byl-front /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2023/04/27 19:09:02 [notice] 1#1: using the "epoll" event method 2023/04/27 19:09:02 [notice] 1#1: nginx/1.23.4 2023/04/27 19:09:02 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 2023/04/27 19:09:02 [notice] 1#1: OS: Linux 5.15.0-1031-aws 2023/04/27 19:09:02 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2023/04/27 19:09:02 [notice] 1#1: start worker processes 2023/04/27 19:09:02 [notice] 1#1: start worker process 20
JavaScript
복사
해당 기록들을 보면 별 다른 이상 없이 제대로 실행이 되고 있는것 같은데 제 Public IP주소 DNS 주소를 주소창에 입력해도 안 됩니다.

Try

Spring/Redis/MySQL 배포시에도 비슷한 오류가 생겨서 인바운드 규칙에서 7777에 해당하는 포트를 열어서 접속한 적 이 있는데 현재 80포트가 열려있어서 8080포트를 열었지만 그래도 여전히 현상이 유지 됩니다.

Solution

너무나 멍청한 이슈였습니다.
version: "3.7" services: nginx: image: "nginx:latest" container_name: next-page-nginx restart: unless-stopped volumes: - /home/ubuntu/next-page/frontend/conf:/etc/nginx/conf.d - /home/ubuntu/next-page/frontend/html:/usr/share/nginx/html ports: - "80:80" networks: - app networks: app: name: server_network external: true
Elm
복사
이렇게 구성된 docker-compose.yml파일을 가지고 실행하고 있었는데 해당 volumes 경로들은 미콴씨칼럼에서 그대로 복사한 채로 사용하고 있었는데 저와는 경로가 달라서 생긴 문제였습니다.
version: "3.7" services: nginx: image: "nginx:latest" container_name: byl-front-nginx restart: unless-stopped volumes: - /home/ubuntu/BYL/Frontend/conf:/etc/nginx/conf.d - /home/ubuntu/BYL/Frontend/html:/usr/share/nginx/html ports: - "80:80" networks: - app networks: app: name: server_network external: true
Elm
복사
현재는 저의 인스턴스의 맞는 경로로 바꿔주었고 정상동작했습니다.