meong_j
기록하는 습관.
meong_j
전체 방문자
오늘
어제
  • 분류 전체보기 (176)
    • 개인 공부 정리 (0)
    • 서버 운영 (37)
      • Linux (36)
    • Frontend (11)
      • Vue.js (10)
    • Backend (70)
      • Java (4)
      • Python (22)
      • Django (38)
      • Spring (6)
    • Database (5)
      • Oracle (4)
      • MySQL (1)
      • MariaDB (0)
    • Android (14)
      • Kotlin (6)
    • 배포 (9)
      • Docker (8)
      • AWS (1)
    • IT_study (29)
      • Coding test (17)
      • 알고리즘 (5)
      • 스터디 (6)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • github

인기 글

반응형

태그

  • docker
  • 이차원배열정렬
  • Kotlin
  • django
  • cpu사용률
  • router-link
  • SASS Variables
  • 배포인프라
  • 개발자도서
  • gabagecollecter
  • 테크커리어
  • 중첩라우트
  • 안드로이드adaptor
  • Proxy
  • DHCP
  • 리눅스인증
  • dockersecret
  • 리눅스방화벽
  • dp #알고리즘
  • 코틀린자료형

최근 댓글

최근 글

250x250
hELLO · Designed By 정상우.
meong_j

기록하는 습관.

Docker Network의 이해 및 구현
배포/Docker

Docker Network의 이해 및 구현

2021. 11. 25. 18:04
728x90
반응형

Docker Network 란?

원래는 container끼리 분리된 환경으로 실행되기 때문에 다른 컨테이너와의 연결 할 수 없다. 하지만 이러한 여러 개의 Docker Container를 하나로 묶어주는 네트워크로 쓰일 수 있으며, Container 이름을 기반으로 서로 네트워크 안에서 주고 받을 수 있다. 

즉, 같은 컨테이너 안에서는 이름으로 호출하여 서로 통신이 가능하게 만들어 준다.

 

 

Create Network

portainer.io 에서 nginx와 django 를 연결시켜주는 네트워크 생성한다.

  • User > nginx port > django 순으로 연결

 

nginx container 설정

Gunicorn nginx 기본 설정 (nginx.conf)

  work_processes auto;

  events {
  }


 server {
    listen 80;
    server_name example.org;
    access_log  /var/log/nginx/example.log;

    location / {
        proxy_pass [설정한_컨테이너_이름]:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  }

https://gunicorn.org/#deployment

 

Gunicorn - Python WSGI HTTP Server for UNIX

Deployment Gunicorn is a WSGI HTTP server. It is best to use Gunicorn behind an HTTP proxy server. We strongly advise you to use nginx. Here's an example to help you get started with using nginx: server { listen 80; server_name example.org; access_log /var

gunicorn.org

 

filezilla 로 생성한 nginx.conf 파일 올리기

https://filezilla-project.org/

 

FileZilla - The free FTP solution

Overview Welcome to the homepage of FileZilla®, the free FTP solution. The FileZilla Client not only supports FTP, but also FTP over TLS (FTPS) and SFTP. It is open source software distributed free of charge under the terms of the GNU General Public Licen

filezilla-project.org

 

nginx 컨테이너 적용

반응형
저작자표시 비영리 변경금지 (새창열림)

'배포 > Docker' 카테고리의 다른 글

Docker Container 의 한계, Docker Stack의 이해  (0) 2021.11.26
Docker Volume  (0) 2021.11.26
[Docker] django 의 Collectstatic 명령어로 Nginx 컨테이너와 동기화 할 static 파일 취합하기  (0) 2021.11.26
[Docker]배포시 static 파일 지원하지 못하는 이유  (0) 2021.11.26
Docker 에 gunicorn 적용한 container 생성하기  (0) 2021.11.25
    '배포/Docker' 카테고리의 다른 글
    • Docker Volume
    • [Docker] django 의 Collectstatic 명령어로 Nginx 컨테이너와 동기화 할 static 파일 취합하기
    • [Docker]배포시 static 파일 지원하지 못하는 이유
    • Docker 에 gunicorn 적용한 container 생성하기
    meong_j
    meong_j
    #it #개발일기 #개발공부 #개발자 #백앤드 #생각정리 #시간은 실력에 비례한다 #뭐든지 꾸준히 열심히 #오늘의 내가 내일의 나를 만든다

    티스토리툴바