jon890 / piu-db

Pump it up Record Management Safely
https://piudb.com
0 stars 0 forks source link

PIU DB

로드맵

우분투 도커 설치

echo "uninstall all conflicting packages"

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

echo "set up docker's apt repository"

sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

echo "install docker packages"

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

echo "docker permission"
sudo /usr/sbin/groupadd -f docker
sudo /usr/sbin/usermod -aG docker USER
sudo chown root:docker /var/run/docker.sock

도커 빌드

docker build -t piudb-web --platform linux/amd64 .

도커 실행

docker run -d -p 3000:3000 --name piudb-web piudb-web

Artifact Registry 업로드

0. 저장소 인증

gcloud auth configure-docker REGION-docker.pkg.dev

0. 저장소 사용 설정 확인

gcloud artifacts repositories describe REPOSITORY \
    --project=PROJECT_ID \
    --location=REGION

1. 도커 로그인

cat KEY_FILE | docker login -u _json_key --password-stdin \
https://REGION-docker.pkg.dev

2. 로컬 이미지 태깅

docker tag piudb-web REGION-docker.pkg.dev/PROJECT_ID/ARTIFACT_REGISTRY_ID/piudb-web

3. 푸시

docker push REGION-docker.pkg.dev/PROJECT_ID/ARTIFACT_REGISTRY_ID/piudb-web

4. 풀

docker pull REGION-docker.pkg.dev/PROJECT_ID/ARTIFACT_REGISTRY_ID/piudb-web