Giter VIP home page Giter VIP logo

Comments (6)

jsmin6330 avatar jsmin6330 commented on September 10, 2024 1

LGTM

from parc02.github.io.

parc02 avatar parc02 commented on September 10, 2024

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.

parc02 avatar parc02 commented on September 10, 2024

step 2


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'
  • 배포 화면
    image

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'
  • 배포 화면
    image

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.

parc02 avatar parc02 commented on September 10, 2024

BUG??

-제 PC에서는 CHROME을 사용하여 주소로 들어가면 화면이 보이지 않지만, CLI환경에서 $ curl https://non-stop-lb.fly.dev/ 명령어를 사용하면 정상적으로 출력되는걸로 보아 캐싱문제가 있는것으로 보입니다. 모바일 환경에서 정상 출력되는건 확인했습니다.

- CLI 환경 캡쳐본

image

- Chrome 캡쳐본

image

- Mobile 환경 캡쳐본

image

from parc02.github.io.

yjinlee99 avatar yjinlee99 commented on September 10, 2024

LGTM

from parc02.github.io.

INAUGURATE-Ryong avatar INAUGURATE-Ryong commented on September 10, 2024

LGTM

from parc02.github.io.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.