Development Environment per Project

Development environment per project

Motivation

Development environments installed in project directory

/home/$USER/test-project/.env

Example of environment file

TOP_DIR=$(dirname $(realpath $_))
. ${TOP_DIR}/venv/bin/activate
export LD_LIBRARY_PATH=${VIRTUAL_ENV}/lib
cd ${TOP_DIR}

Append alias to shell

~/.aliases

alias test-project-env=". ~/working/test-project/.env"

~/.bashrc or ~/.zshrc

. ~/.aliases

Appply alias without restart shell

source ~/.aliases

onto test-project environment

test-project-env

Using Docker

Create Docker image for development

docker build -t test-project-dev-env:latest .

Run docker image for testing

docker run --rm -it  -v $(pwd):/apps test-project-devel bash

크리에이티브 커먼즈 라이선스
이 저작물은 크리에이티브 커먼즈 저작자표시 4.0 국제 라이선스 에 따라 이용할 수 있습니다.

Share