- 로컬에서는 실행 확인
shimguh / s.blog Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
요구사항
fly.io 에 배포한 도커 이미지가
1분 마다 git pull 을 수행해서
github 에 PUSH 하면 1분 안에 새로운 홈페이지가 반영 되도록
- 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
FROM node:20.11
WORKDIR /app
RUN npm install -g npm
RUN npm install -g json-server
COPY ./db.json /app
CMD ["json-server", "-p", "80", "-w", "/app/db.json"]
$ tail -n 3 ~/.zshrc
# fly
export FLYCTL_INSTALL="/home/<본인아이디>/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"
$ source ~/.zshrc
$ flyctl launch
? Do you want to tweak these settings before proceeding? Yes
VM 1GB -> 256MB
port 설정
$ cat fly.toml
cat fly.toml
# fly.toml app configuration file generated for s-blog on 2024-02-15T13:39:44+09:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 's-blog'
primary_region = 'nrt'
[build]
[http_service]
internal_port = 80
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
size = 'shared-cpu-1x'
$ flyctl deploy
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.