Readmes
This commit is contained in:
parent
bdea6e655a
commit
cf35807bea
2 changed files with 141 additions and 60 deletions
|
|
@ -16,7 +16,7 @@
|
|||
- sudo apt update
|
||||
- sudo apt install apt-transport-https ca-certificates curl software-properties-common
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $- (lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
- sudo apt update
|
||||
- apt-cache policy docker-ce
|
||||
- sudo apt install docker-ce
|
||||
|
|
@ -24,7 +24,17 @@
|
|||
- sudo usermod -aG docker ${USER}
|
||||
- su - ${USER}
|
||||
- sudo reboot
|
||||
-
|
||||
- sudo su
|
||||
- cd /etc/docker
|
||||
- touch daemon.json
|
||||
daemon.json dosyasının içerisine aşağıdaki satırlar eklenecek.
|
||||
{
|
||||
"insecure-registries": ["devops.sozsoft.com"]
|
||||
}
|
||||
- sudo systemctl restart docker
|
||||
- /etc/hosts dosyası açılacak ve içerisine `127.0.1.1 devops.sozsoft.com` eklenecek
|
||||
- docker login devops.sozsoft.com
|
||||
|
||||
## Sertifika alma
|
||||
|
||||
- sudo apt-get remove certbot
|
||||
|
|
@ -41,39 +51,9 @@
|
|||
- cd sozsoft.com/
|
||||
- sudo chmod 775 *
|
||||
|
||||
## docker-compose-devops.yml kurulumu
|
||||
## Forgejo kurulumu ayarları yapılacak
|
||||
|
||||
Bu kurulumu yapmak için home klasörü altına 3 tane dosyaya ihtiyaç duyuyor. Aşağıdaki klasör ve dosya yapısı kurulmalıdır.
|
||||
-> kurs-platform->configs->deployment->configs->nginx-devops.conf
|
||||
-> kurs-platform->configs->deployment->docker-compose-devops.yml
|
||||
-> kurs-platform->configs->deployment->Dockerfile
|
||||
|
||||
Bu dosyaları el ile oluşturduğumuz için kullanım yetkisi yok. Yetki verebilmek için configs->deployment klasöründe aşağıdaki kod çalıştırılır.
|
||||
-> chmod 775 *
|
||||
|
||||
`docker compose -f ./docker-compose-devops.yml up -d` kodu çalıştırıldı.
|
||||
n8n çalışmayınca `docker run --rm -v kurs-devops_n8n_data:/data alpine chown -R 1000:1000 /data` kodu çalıştırılacak.
|
||||
`docker compose -f ./docker-compose-devops.yml down` kodu çalıştırıldı.
|
||||
`docker compose -f ./docker-compose-devops.yml up -d` kodu çalıştırıldı.
|
||||
|
||||
## devops.sozsoft.com olarak sanal dns isimlendirmesi
|
||||
|
||||
/etc/hosts dosyası açılacak ve içerisine `127.0.1.1 devops.sozsoft.com` eklenecek
|
||||
|
||||
## Docker ayarları yapılacak
|
||||
|
||||
sudo su
|
||||
cd /etc/docker
|
||||
touch daemon.json
|
||||
daemon.json dosyasının içerisine aşağıdaki satırlar eklenecek.
|
||||
{
|
||||
"insecure-registries": ["devops.sozsoft.com"]
|
||||
}
|
||||
docker login devops.sozsoft.com
|
||||
|
||||
## Forgejo ayarları yapılacak
|
||||
|
||||
home klasöründeki `cd ~/forgejo/data/gitea/conf` klasörün altındaki app.ini dosyasına aşağıdaki satırlar eklenecek.
|
||||
- home klasöründeki `cd ~/forgejo/data/gitea/conf` klasörün altındaki app.ini dosyasına aşağıdaki satırlar eklenecek.
|
||||
[server]
|
||||
APP_DATA_PATH = /data/gitea
|
||||
DOMAIN = devops.sozsoft.com
|
||||
|
|
@ -89,22 +69,54 @@
|
|||
ROOT_URL = https://devops.sozsoft.com/
|
||||
CERT_FILE = /etc/ssl/cert1.pem
|
||||
KEY_FILE = /etc/ssl/privkey1.pem
|
||||
- https://devops.sozsoft.com
|
||||
- sedat.ozturk isimli kullanıcı tanımlanacak.
|
||||
- "kurs" isimli new organization tanımlanacak.
|
||||
- "kurs-platform" isimli repository kurs organizasyonunun içerisine tanımlanacak.
|
||||
- Fork üzerinden Remotes tanımlaması yapılacak. Remote: devops.sozsoft.com RepositoryUrl: https://devops.sozsoft.com/kurs/kurs-platform
|
||||
- Fork üzerinden Authorization işlemi yapılacak URL kısmı localhost olarak geliyor. Onu devops.sozsoft.com olarak değiştirmek gerekiyor.
|
||||
|
||||
## https://devops.sozsoft.com kurulumu ayarları
|
||||
## docker-compose-devops.yml kurulumu
|
||||
|
||||
sedat.ozturk isimli kullanıcı tanımlanacak.
|
||||
"kurs" isimli new organization tanımlanacak.
|
||||
"kurs-platform" isimli repository kurs organizasyonunun içerisine tanımlanacak.
|
||||
Fork üzerinden Remotes tanımlaması yapılacak. Remote: devops.sozsoft.com RepositoryUrl: https://devops.sozsoft.com/kurs/kurs-platform
|
||||
Fork üzerinden Authorization işlemi yapılacak URL kısmı localhost olarak geliyor. Onu devops.sozsoft.com olarak değiştirmek gerekiyor.
|
||||
cd ~
|
||||
git config core.fileMode false
|
||||
git config --global http.sslVerify false
|
||||
git clone https://devops.sozsoft.com/kurs/kurs-platform.git
|
||||
Bu kurulumu yapmak için home klasörü altına 3 tane dosyaya ihtiyaç duyuyor.
|
||||
|
||||
## Build
|
||||
- Klasör yapısı
|
||||
cd ~/
|
||||
mkdir kurs-platform
|
||||
cd kurs-platform
|
||||
mkdir configs
|
||||
cd configs
|
||||
mkdir deployment
|
||||
cd deployment
|
||||
mkdir configs
|
||||
|
||||
~/kurs-platform klasöründe `chmod 775 *` çalıştırılacak
|
||||
~/kurs-platform/configs/deployment klasöründe `chmod 775 *` çalıştırılacak
|
||||
~/kurs-platform/configs/deployment/scripts klasöründe `chmod 775 *` çalıştırılacak
|
||||
~/kurs-platform/configs/deployment/configs klasöründe `chmod 775 *` çalıştırılacak
|
||||
- Dosya yapısı
|
||||
-> kurs-platform->configs->deployment->configs->nginx-devops.conf
|
||||
-> kurs-platform->configs->deployment->docker-compose-devops.yml
|
||||
-> kurs-platform->configs->deployment->Dockerfile
|
||||
|
||||
cd ~/kurs-platform/configs/deployment
|
||||
chmod 775 *
|
||||
cd ~/kurs-platform
|
||||
docker compose -f ./docker-compose-devops.yml up -d
|
||||
n8n çalışmayınca `docker run --rm -v kurs-devops_n8n_data:/data alpine chown -R 1000:1000 /data` kodu çalıştırılacak.
|
||||
docker compose -f ./docker-compose-devops.yml down
|
||||
docker compose -f ./docker-compose-devops.yml up -d
|
||||
|
||||
## Git Kurulumu
|
||||
|
||||
- cd ~
|
||||
- git config --global http.sslVerify false
|
||||
- git clone https://devops.sozsoft.com/kurs/kurs-platform.git
|
||||
- cd kurs-platform/
|
||||
- git config core.fileMode false
|
||||
- chmod 775 *
|
||||
- cd configs/deployment
|
||||
- chmod 775 *
|
||||
- cd configs
|
||||
- chmod 775 *
|
||||
- cd ..
|
||||
- cd scripts
|
||||
- chmod 775 *
|
||||
- cd ~/kurs-platform
|
||||
- ./build-production.sh
|
||||
69
configs/deployment/Readme_Production.md
Normal file
69
configs/deployment/Readme_Production.md
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# Production Makinası kurulumu
|
||||
|
||||
## VS Code -> Extensions kısmında "Docker" kurulmalıdır.
|
||||
|
||||
## VS Code -> Extensions kısmında "Save as Root in Remote" kurulmalıdır.
|
||||
|
||||
## VS Code üzerinden SSH parolası sabitleme (Firewall ve SSH)
|
||||
|
||||
- Windows Terminal üzerinde ssh_keygen komutu çalıştırılır.
|
||||
- C:\Users\sedat.ozturk\.ssh klasörün altında id_rsa ve id_rsa.pub isimli 2 dosya oluşturur.
|
||||
- C:\Users\sedat.ozturk\.ssh dosyasının içerisindeki id_rsa.pub dosyasının içeriğini ~/.ssh klasöründeki authorized_keys içeriğine kopyalanır.
|
||||
- Bu sayede VS Code üzerinden bağlanırken her defasında ssh paroları yazmak durumunda olmayız.
|
||||
|
||||
## Docker kurulumu
|
||||
|
||||
- sudo apt update
|
||||
- sudo apt install apt-transport-https ca-certificates curl software-properties-common
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
- sudo apt update
|
||||
- apt-cache policy docker-ce
|
||||
- sudo apt install docker-ce
|
||||
- sudo systemctl status docker
|
||||
- sudo usermod -aG docker ${USER}
|
||||
- su - ${USER}
|
||||
- sudo reboot
|
||||
- sudo su
|
||||
- cd /etc/docker
|
||||
- touch daemon.json
|
||||
daemon.json dosyasının içerisine aşağıdaki satırlar eklenecek.
|
||||
{
|
||||
"insecure-registries": ["devops.sozsoft.com"]
|
||||
}
|
||||
- /etc/hosts dosyası açılacak ve içerisine `192.168.0.2 devops.sozsoft.com` eklenecek
|
||||
- sudo systemctl restart docker
|
||||
- docker login devops.sozsoft.com
|
||||
|
||||
## Sertifika alma
|
||||
|
||||
- DevOps makinasının ${USER} klasöründeyer alan ssl klasörü ("sozsoft.com") download edilecek
|
||||
- ~/ home klasörüne ssl klasörü kopyalacaktır.
|
||||
- ~/sozsoft.com klasöründe `chmod 775 *` çalıştırılacaktır.
|
||||
- `ssh-keygen` komutu çalıştırılır ve .ssh klasörünün altına `id_` ile başlayan 2 dosya oluşacak. `.pub` uzantılı dosyanın içeriği kopyalanacak ve https://devops.sozsoft.com/kurs/kurs-platform/settings/keys `Add deploy key` butonuna basarak eklenecektir.
|
||||
|
||||
|
||||
## Git Kurulumu
|
||||
|
||||
- cd ~
|
||||
- git config --global http.sslVerify false
|
||||
- git clone https://devops.sozsoft.com/kurs/kurs-platform.git
|
||||
- cd kurs-platform/
|
||||
- git config core.fileMode false
|
||||
- chmod 775 *
|
||||
- cd configs/deployment
|
||||
- chmod 775 *
|
||||
- cd configs
|
||||
- chmod 775 *
|
||||
- cd ..
|
||||
- cd scripts
|
||||
- chmod 775 *
|
||||
- cd ~/kurs-platform
|
||||
|
||||
## Deploy
|
||||
|
||||
- cd ~/kurs-platform/configs/deployment
|
||||
- docker compose -f docker-compose-data.yml up -d
|
||||
- cd ~/kurs-platform/configs/deployment/scripts
|
||||
- ./2-app.sh production
|
||||
- ./2-migrator.sh true production
|
||||
Loading…
Reference in a new issue