Comments (6)
from parc02.github.io.
STEP 1
- ~/code/non-stop 경로에 폴더 생성
.
├── cron-1
│ ├── Dockerfile
│ ├── blog-pull-cronjob
│ ├── fly.toml
│ └── ~
├── cron-2
│ ├── Dockerfile
│ ├── blog-pull-cronjob
│ ├── fly.toml
│ └── ~
└── lb
├── Dockerfile
├── config
│ └── default.conf
├── fly.toml
└── ~
DOCKERFILE(SERVER A, B)
FROM ubuntu:22.04
RUN apt update
RUN apt install -y nginx
RUN apt install -y git
RUN apt install cron
RUN rm -rf /var/www/html
RUN git clone https://github.com/parc02/parc02.github.io.git /var/www/html
COPY blog-pull-cronjob /etc/cron.d
RUN crontab /etc/cron.d/blog-pull-cronjob
RUN crontab -l
CMD service cron start;nginx -g 'daemon off;'
blog-pull-cronjob(SERVER A, B)
* * * * * sh /var/www/html//pull.sh >> /var/log/pull.log 2>&1
# new crontab file is missing newline before EOF, can't install.
default.conf(LB)
upstream serv {
server non-stop-a.internal:80;
server non-stop-b.internal:80;
}
server {
listen 80;
location /
{
proxy_pass http://serv;
}
}
DOCKERFILE(LB)
FROM nginx
COPY config/default.conf /etc/nginx/conf.d
각각 폴더에서 빌드 (images)
sudo docker build -t non-stop-a .
sudo docker build -t non-stop-b .
sudo docker build -t non-stop-lb .
REPOSITORY TAG IMAGE ID CREATED SIZE
non-stop-a latest 61458ac0e562 About a minute ago 391MB
non-stop-b latest 61458ac0e562 About a minute ago 391MB
non-stop-lb 0.1.0 43e0712bca25 14 minutes ago 187MB
from parc02.github.io.
step 2
- fly.io 에 배포하기 (serv a, serv b, serv lb)
- Install Guide
- REF: fly-io-internal-addresses
serv-a
- fly.toml
# fly.toml app configuration file generated for non-stop-a on 2024-02-16T14:32:15+09:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'non-stop-a'
primary_region = 'nrt'
[build]
[http_service]
internal_port = 80
force_https = true
auto_stop_machines = false
auto_start_machines = false
min_machines_running = 0
processes = ['app']
[[vm]]
size = 'shared-cpu-1x'
serv-b
- fly.toml
# fly.toml app configuration file generated for non-stop-b on 2024-02-16T14:51:02+09:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'non-stop-b'
primary_region = 'nrt'
[build]
[http_service]
internal_port = 80
force_https = true
auto_stop_machines = false
auto_start_machines = false
min_machines_running = 0
processes = ['app']
[[vm]]
size = 'shared-cpu-1x'
serv-lb
- fly.toml
# fly.toml app configuration file generated for non-stop-lb on 2024-02-16T21:59:50+09:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'non-stop-lb'
primary_region = 'nrt'
[build]
[http_service]
internal_port = 80
force_https = true
auto_stop_machines = false
auto_start_machines = false
min_machines_running = 3
processes = ['app']
[[vm]]
size = 'shared-cpu-1x'
from parc02.github.io.
BUG??
-제 PC에서는 CHROME을 사용하여 주소로 들어가면 화면이 보이지 않지만, CLI환경에서 $ curl https://non-stop-lb.fly.dev/ 명령어를 사용하면 정상적으로 출력되는걸로 보아 캐싱문제가 있는것으로 보입니다. 모바일 환경에서 정상 출력되는건 확인했습니다.
- serv-a : https://non-stop-a.fly.dev/
- serv-b: https://non-stop-b.fly.dev/
- serv-lb: https://non-stop-lb.fly.dev/
- CLI 환경 캡쳐본
- Chrome 캡쳐본
- Mobile 환경 캡쳐본
from parc02.github.io.
from parc02.github.io.
from parc02.github.io.
Related Issues (4)
- 네이버 검색 최적화 간단체크 가이드 적용 HOT 4
- 구글 서치콘솔 가이드 적용
- github action 따라하기 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parc02.github.io.