νμ€ν μΉπ κ°λ°μ μ§λ§μ π§π½βπ»
β μΈκ³΅μ§λ₯ κ΄μ¬ π€
Categories
-
β£
βΆ COMPUTER_SCIENCE
π: 7 -
β£
βΆ WEB
π: 3 -
β£
βΆ ETC
π: 3-
β
β£
ETCS
π: 10 -
β
β£
SUBBRAIN κ°λ°κΈ°
π: 5 -
β
β
YOS κ°λ°κΈ°
π: 1
-
β
β£
-
β
βΆ AI
π: 9-
β£
AITOOLS
π: 3 -
β£
CV
π: 2 -
β£
DEEP_LEARNING
π: 1 -
β£
DATA_VIS
π: 2 -
β£
GRAPH
π: 1 -
β£
LIGHTWEIGHT
π: 1 -
β£
MATH
π: 1 -
β£
NLP
π: 3 -
β
STRUCTURED_DATA
π: 2
-
β£
docker-compose κ°λ
docker-compose
docker-compose
λ₯Ό μ΄μ©νλ€λ©΄ μ¬λ¬ λ컀 컨ν
μ΄λμ μ°κ³μ μ€μ μ μμ½κ² ν μ μλ€.
docker-compose μ€μΉ
λ¨Όμ docker-composeλ₯Ό κΉκΈ° μν΄ μμ Docker
κ° μ€μΉλμ΄μΌ μμ΄μΌ νλ€.
-
[Install Docker Compose CLI plugin Docker Documentation](https://docs.docker.com/compose/install/) μ°Έκ³ (μ΅μ λ²μ μΌλ‘ μ λ°μ΄νΈ λλ μ½λ)
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.14.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
λ§μ½, 무쑰건 μ΅μ μ docker-composeλ₯Ό λ€μ΄λ°κ³ μΆλ€λ©΄
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
λ§μ½ μ μ½λλ‘ μλλ€λ©΄ κ·Έ μμ μ μ΄ λμ λ§ν¬λ₯Ό μ°Έμ‘°ν΄ λ³΄μ.
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
μ μ½λλ₯Ό ν΅ν΄ docker-compose
μ κΆνμ λ°κΏμ€λ€.
version: '3'
services:
nginx:
container_name: nginx # 컨ν
μ΄λλͺ
build: ./nginx # dockerfile κ²½λ‘
image: server_dev/nginx # λΉλ ν μ΄λ―Έμ§λͺ
restart: always # μ£½μΌλ©΄ μ¬μμ
ports:
- "80:80"
volumes: # 컨ν
μ΄λκ° μ¬μ©ν μ μ₯ 곡κ°, μ΄λ₯Ό ν΅ν΄ 컨ν
μ΄λκ° μμ΄μ Έλ μ μ₯ 곡κ°μ κ°μ λ¨μ
- ./backend:/srv/docker-server/backend
- ./log:/srv/docker-server/log/nginx
depends_on: # λ¨Όμ μμν΄μΌ νλ μμμ 컨ν
μ΄λ
- django
django:
container_name: django
build: ./backend
image: server_dev/django
restart: always
command: uwsgi --ini uwsgi.ini # Dockerfileμ CMD λͺ
λ Ήλ¬Έμ 무μνκ³ μ€νν λͺ
λ Ήμ΄λ₯Ό μ€μ νκΈ° μν΄μ μ¬μ©λ©λλ€.
volumes:
- ./backend:/srv/docker-server/backend
- ./log:/srv/docker-server/log/uwsgi
μμ κ°μ΄ docker-compose.yml
μ μ€μ ν μμλ€. μμ λ λ°±μλ μλ²μ μΉμλ²λ₯Ό μ°κ²°νλ μμ μ΄λ€.
sudo docker-compose up -d --build
-
-d
: λ°±κ·ΈλΌμ΄λ μ€ν -
--build
: μλ‘ μ΄λ―Έμ§λ₯Ό λΉλ
μμ κ°μ 컀맨λλ‘ Docker 컨ν μ΄λλ€μ νκΊΌλ²μ μ€νν μ μκ³ , μ€λ₯κ° μλ€λ©΄ μλμ μ΄ μ»¨ν μ΄λκ° μ€νλλ€. (μμ λ κΊΌμ Έμλ μν)
sudo docker-compose ps // λ컀 컨ν
μ΄λλ€μ λͺ©λ‘ 보기
NAME COMMAND SERVICE STATUS PORTS
django "uwsgi --ini uwsgi.iβ¦" django exited (137)
nginx "/docker-entrypoint.β¦" nginx exited (0)
π΅ λ‘κΉ μ€μ μΆμ²
μ°Έκ³ λ‘, νκΊΌλ²μ 컨ν μ΄λλ₯Ό μ€ννλ©΄μ μλ²μ λ©μμ§κ° μ½μμ κ²Ήμ³μ 보μ΄λ©°, λ°λͺ¬ μνλ‘ μ€νμ€ μΌ λλ μμ 보μ΄μ§ μμΌλ―λ‘, λλ²κΉ μ μν΄ μ¬μ©νλ κΈ°μ μ€νμ λ‘κΉ μ μ λλ‘ μ€μ νλ κ²μ΄ μ’λ€.
> django | [uWSGI] getting INI configuration from uwsgi.ini > nginx | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration > nginx | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ > nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh >
μΌλ°μ μΌλ‘ μμ κ°μ΄ νμλλ€.
_articles/web/CI,CD/Docker/docker-compose κ°λ .md