- ๐ Hi, Iโm @Jaelinny
jaelinny / jelly-blog Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://jelly-blog.fly.dev/
Home Page: https://jelly-blog.fly.dev/
3881* cd code/pysatellite.blog
3882* clear
3883 pwd
3884 sudo docker run -dit ubuntu:22.04
3885 sudo docker ps
3886 sudo docker exec -it 362e1c1e57bf bash
3887* vi Dockerfile
3888* git add .
3889* cat Dockerfile
3890* vi Dockerfile
3891 clear
3892 pwd
3893 ls
3894 sudo docker build -t unginx:240215 .
3895 sudo docker images
3896 sudo docker ps -a
3897 sudo docker stop 362e1c1e57bf;sudo docker rm 362e1c1e57bf
3898 sudo docker images
3899 sudo docker run -d -p 8888:80 unginx:240215
3900 sudo docker ps
#!/bin/bash
# var
BLOG_1="pysatellite-blog-a.internal"
BLOG_2="pysatellite-blog-b.internal"
BLOG_1_IMG_NAME="blog-1-img"
BLOG_2_IMG_NAME="blog-2-img"
# start
# sl -aF
figlet -f bubble start
#############################
figlet remove all
sudo docker stop $(sudo docker ps -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker rmi $(sudo docker images -q)
sudo docker network rm blog-net
#############################
# https://docs.docker.com/engine/reference/commandline/image_build/
figlet build
sudo docker image build -t $BLOG_1_IMG_NAME -f docker/blog-a/Dockerfile docker/blog-a
sudo docker image build -t $BLOG_2_IMG_NAME -f docker/blog-b/Dockerfile docker/blog-b
sudo docker image build -t blog-lb -f docker/lb/Dockerfile docker/lb
#############################
# https://docs.docker.com/engine/reference/commandline/network_create/
figlet create network
sudo docker network create -d bridge blog-net
#############################
# https://docs.docker.com/engine/reference/commandline/container_run/
figlet run
sudo docker container run -d --name $BLOG_1 -p 8001:80 --network blog-net $BLOG_1_IMG_NAME
sudo docker container run -d --name $BLOG_2 -p 8002:80 --network blog-net $BLOG_2_IMG_NAME
sudo docker container run -d --name blog-lb-1 -p 8000:80 --network blog-net blog-lb
#############################
figlet ps
sudo docker container ps
figlet -f TEST
curl http://localhost:8000 | grep h1
curl http://localhost:8000 | grep h1
# end
figlet -f bubble END
$ sudo docker build -t taengguu/auto-lb:0.1.0 .
$ sudo docker push taengguu/auto-lb:0.1.0
The push refers to repository [docker.io/taengguu/auto-lb]
68e50b78a814: Pushed
c21bee363d32: Pushed
b05bf7593243: Pushed
3186db24a04f: Pushed
e9e54173d788: Pushed
fccdbd3f4153: Pushed
041ae49dfaa3: Pushed
939fce180f82: Pushed
af77b504c612: Pushed
d101c9453715: Mounted from library/ubuntu
0.1.0: digest: sha256:f5c2ed410cd8c5a030487fededa9b790c183e13b637844afb7654ab7238f990c size: 2416
$ sudo docker build -t taengguu/auto-lb:0.1.0 -f Dockerfile .
$ sudo docker run -d --name taengguu -p 7070:80 taengguu/auto-lb:0.1.0
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90d3a77db267 taengguu/auto-lb:0.1.0 "/bin/sh -c 'serviceโฆ" 4 seconds ago Up 3 seconds 0.0.0.0:7070->80/tcp, :::7070->80/tcp taengguu
$ cat compose.yml
version: '3.8'
name: awsgoo
services:
nginx-proxy:
image: nginxproxy/nginx-proxy # https://github.com/nginx-proxy/nginx-proxy
ports:
- "9889:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
- blog
deploy:
resources:
limits:
cpus: '0.10'
memory: 50M
reservations:
cpus: '0.05'
memory: 30M
blog:
# build: ../../docker_file/httpd
image: taengguu/auto-lb:0.1.0
deploy:
mode: replicated
replicas: 1 # https://docs.docker.com/compose/compose-file/deploy/#replicas
expose:
- "80"
environment:
- VIRTUAL_HOST=aws.google.com
- VIRTUAL_PORT=80
$ docker compose -f compose.yml up -d --build --force-recreate
[+] Running 14/14
โ nginx-proxy 13 layers [โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ] 0B/0B Pulled 9.2s
โ e1caac4eb9d2 Already exists 0.0s
โ 88f6f236f401 Pull complete 2.3s
โ c3ea3344e711 Pull complete 0.8s
โ cc1bb4345a3a Pull complete 0.8s
โ da8fa4352481 Pull complete 1.6s
โ c7f80e9cdab2 Pull complete 2.6s
โ 18a869624cb6 Pull complete 2.3s
โ 66ab28d11695 Pull complete 3.0s
โ 79b57e45edb0 Pull complete 3.2s
โ 2be787a40ace Pull complete 3.6s
โ 563a441cec03 Pull complete 3.8s
โ 4994460aae36 Pull complete 3.9s
โ 4f4fb700ef54 Pull complete 4.3s
[+] Running 2/3
โ ด Network awsgoo_default Created 2.5s
โ Container awsgoo-blog-1 Started 2.0s
โ Container awsgoo-nginx-proxy-1 Started 0.9s
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dd30a0bf9915 nginxproxy/nginx-proxy "/app/docker-entrypoโฆ" About a minute ago Up About a minute 0.0.0.0:9889->80/tcp, :::9889->80/tcp awsgoo-nginx-proxy-1
df8fdb7d7e67 taengguu/auto-lb:0.1.0 "/bin/sh -c 'serviceโฆ" About a minute ago Up About a minute 80/tcp awsgoo-blog-1
90d3a77db267 taengguu/auto-lb:0.1.0 "/bin/sh -c 'serviceโฆ" 20 minutes ago Up 20 minutes 0.0.0.0:7070->80/tcp, :::7070->80/tcp taengguu
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jelly 123 03fb1041108a 35 minutes ago 462MB
taengguu/auto-lb 0.1.0 03fb1041108a 35 minutes ago 462MB
nginxproxy/nginx-proxy latest 1a3960925c12 3 hours ago 204MB
- Crontab ๊ท์น
* * * * * ์ ์ ์ด๋ฆ ๋ช
๋ น์ด
โฌ โฌ โฌ โฌ โฌ
โ โ โ โ โโ ์์ผ (0 - 6) (0:์ผ์์ผ, 1:์์์ผ, 2:ํ์์ผ, โฆ, 6:ํ ์์ผ)
โ โ โ โโ ์ (1 - 12)
โ โ โโ์ผ (1 - 31)
โ โโ ์ (0 - 23)
โโ ๋ถ (0 - 59)
- ์์
1. ๋งค๋ถ, ๋งค์๊ฐ, ๋งค์ผ, ๋งค์, ์ฆ 1๋ถ๋ง๋ค /home/ubuntu/start.sh ํ์ผ์ ์คํ
* * * * * root /home/ubuntu/start.sh
2. 0๋ถ, 4์, ๋งค์ผ, ๋งค์, ๋งค์ผ, ์ฆ ๋งค์ผ 4์์ /home/ubuntu/start.sh ํ์ผ์ ์คํ
0 4 * * * root /home/ubuntu/start.sh
3. 10๋ถ ๊ฐ๊ฒฉ, 4์, ๋งค์ผ, ๋งค์, ๋งค์ผ, ์ฆ ๋งค์ผ 4์, 4์ 10๋ถ, 4์ 20๋ถ, 4์ 30๋ถ /home/ubuntu/start.shํ์ผ์ ์คํ
*/10 4 * * * root /home/ubuntu/start.sh
4. 6์๊ฐ๋ง๋ค /home/ubuntu/start.sh ํ์ผ์ ์คํ
0 */6 * * * root /home/ubuntu/start.sh
5. ํ์ผ(์์์ผ~๊ธ์์ผ) 08:00์ /home/ubuntu/start.sh ํ์ผ์ ์คํ
0 8 * * 1-5 root /home/ubuntu/start.sh
6. ์ฃผ๋ง(์ผ์์ผ, ํ ์์ผ) 08:00 ์ /home/ubuntu/start.sh ํ์ผ์ ์คํ
0 8 * * 0,6 root /home/ubuntu/start.sh
7. ๋งค์ผ ์๋ฒฝ 5์์ ์ฌ๋ถํ
ํ๊ธฐ
0 5 * * * root /sbin/shutdown -r now
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.