-
Notifications
You must be signed in to change notification settings - Fork 3
/
oci-boot-script.sh
56 lines (47 loc) · 1.52 KB
/
oci-boot-script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
sudo apt update
sudo apt -y upgrade
sudo timedatectl set-timezone Asia/Seoul
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
sudo ufw allow 21
sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 8000
sudo ufw allow 9443
yes | sudo ufw enable
sudo systemctl enable ufw.service
sudo ufw restart
sudo ufw status
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo apt-get -y install docker-compose
sudo mkdir -p /data/npm
sudo docker run -d -p 80:80 -p 443:443 -p 81:81 --name npm --restart=unless-stopped -v /data:/data -v /letsencrypt:/etc/letsencrypt jc21/nginx-proxy-manager:latest
sudo mkdir -p /data/portainer
sudo docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
sudo docker network create npm-net
sudo docker network connect npm-net npm
sudo docker network connect npm-net portainer
ip="$(curl --silent icanhazip.com)"
echo ""
echo ""
echo "===== oci boot script ====="
echo ""
echo "부트 스크립트 설정이 완료되었습니다."
echo ""
echo "- Nginx Proxy Manager"
echo "http://$ip:81"
echo ""
echo "- NPM 기본 로그인"
echo "Email: [email protected]"
echo "Password: changeme"
echo ""
echo "- Portainer"
echo "http://$ip:8000"
echo ""
echo "NPM과 다른 컨테이너를 연결하려면 npm-net 네트워크에 연결하세요."