Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
さくらのクラウドとDocker Swarm Modeで誰でもわかる簡単デプロイ @ さくら...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
chibiegg
December 23, 2019
Technology
4.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
さくらのクラウドと Docker Swarm Modeで 誰でもわかる簡単デプロイ @ さくらの聖夜2019 / Simple Deployment with SAKURA Cloud and Docker Swarm
chibiegg
December 23, 2019
More Decks by chibiegg
See All by chibiegg
ブラックボックス観測に基づくAI支援のプロトコルのリバースエンジニアリングと再現~AIを用いたリバースエンジニアリング~ @ SECCON 14 電脳会議 / Reverse Engineering and Reproduction of an AI-Assisted Protocol Based on Black-Box Observation @ SECCON 14 DENNO-KAIGI
chibiegg
1
230
ゼロトラストを前提に、もっと便利に、もっと安全に @ 2026-03-03 ITmedia Security Week 2026 冬 / Designing for Zero Trust: Enabling Both Usability and Security
chibiegg
0
150
JANOG57 Meeting in Osaka のご紹介 @さくらの聖夜 2025 / Introduction to JANOG57 Meeting in Osaka
chibiegg
0
91
コンフィデンシャルコンピューティングは本当に機密なのか?@ 2025-08-23 LOCAL Developer Day ’25 Security with 在札幌米国総領事館 / Confidential Computing Truly Confidential? @ 2025-08-23 LOCAL Developer Day ’25 Security with the U.S. Consulate General in Sapporo
chibiegg
0
85
パブリッククラウドにおける機密コンピューティング@さくらのTech Day 2024-11-12 / Confidential Computing in Public Cloud
chibiegg
0
510
tiupによるTiDBの構築 @ TiUG Meetup #3 Osaka / Building TiDB with TiUP
chibiegg
1
360
Stable Diffusionの使い方と追加学習によるLoRAの作成~GPUコンテナサービス “高火力 DOK” の活用~ @ 2024-06-29 OSC2024 Hokkaido / Stable Diffusion and Creating LoRA with Additional Training ~ with 'Koukaryoku DOK' ~
chibiegg
1
2.9k
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
3
2.1k
3年近くTiDBを使ってきた話 @ TiUG Kick Off #0 / My Journey with TiDB: Nearly Three Years On @ TiDB User Group Kick Off #0
chibiegg
4
1.5k
Other Decks in Technology
See All in Technology
Claude Code をローカルとサーバー上で利用した際の Bedrock 利用料をユーザー単位で一本化してみる
ohorig
0
170
AI秘書と毎日働くのはもう当たり前。開発以外の業務に足りない機能をどう埋める?
minorun365
PRO
4
1.8k
CSS2026:OWS研究会・招待講演「世界観を、実装する」
atsush1_sada
2
340
プロダクトが成長すると、 プロダクトマネージャーの仕事はどう変わるのか - 「まず作る」から「小さく学び、確かめながら進む」へ
sansantech
PRO
2
400
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
300
[re:Invent2026事前勉強会(有志開催)]続きは、ラスベガスの廊下で / continue-in-the-vegas-hallway
sh_fk2
0
290
1週間、Opus封印でお願いします
kintotechdev
0
230
Vue で書く 空間コンピューティング、TresJS と WebXR を使ったXR デバイスのフロントエンド開発
hiranuma
0
110
LLM Content Moderationを支える評価・改善ループの実践
suikabar
2
370
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
200
AWSDirectConnectの構築の進め方を整理してみた
masa_my
1
200
AI時代の開発はウォーターフォールに回帰する? / development-with-ai-back-to-wf
okamototakuyasr2
0
130
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Cost Of JavaScript in 2023
addyosmani
55
10k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
650
Side Projects
sachag
456
43k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
370
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
310
Claude Code のすすめ
schroneko
67
230k
Odyssey Design
rkendrick25
PRO
2
890
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
530
Transcript
さくらのクラウドと Docker Swarm Modeで 誰でもわかる簡単デプロイ 2019-12-23 @さくらの聖夜2019 ©SAKURA internet Inc.
さくらインターネット株式会社 執行役員 技術推進統括担当 兼 CISO 江草 陽太
⾃⼰紹介 2 【所属等】 さくらインターネット株式会社 新卒入社 執行役員 技術推進統括担当 兼 CISO 【開発】
• さくらのVPS API/DB/制御システム担当 • sakura.io ハードウエア仕様、ファームウエア開発 システム設計、開発、インフラ設計、構築 • 社内システム/データセンター自動化 • さくらのエンジニアリングラボ 【その他】 • CSAJ U22プログラミングコンテスト審査員 • Home NOC Operators’ Group (AS59105) @chibiegg
⾃⼰紹介 3 【経歴】 • ロボカップジュニア (中学・高校) / NHK大学ロボコン • 大阪大学工学部電子情報工学科情報通信工学専攻
• 個人事業主 • 大阪大学大学院工学研究科中退 • SECCON CTF 2014 国内4位 • ISUCON5/ISUSON7/ISUCON8本戦、ISUCON9問題作成 • ICTSC7 大人チーム 【専門】 • ソフトウエアエンジニア • NW/SC/DBスペシャリスト • 回路設計/組み込みソフトウエア 【趣味】 旅行/温泉/写真/電子工作/プログラミング/かわいい服 @chibiegg
よくあるアプリケーション 4 Nginx django Redis PostgreSQL
よく使うミドルウエア 5 • Nginx • リバースプロキシと静的ファイル配信 • Django • Webアプリケーション本体
• Redis/Memcached • グラフデータ等のキャッシュ • PostgreSQL/MariaDB • データベース
古典的な⽅法でのデプロイ 6 • パッケージのインストール • posrgresql-10, python3-pip, redis, nginx •
ソースコードを持って来る • Pythonパッケージをインストールする • 各種設定ファイルを書く • データベースをセットアップする • サービス登録する
2019/12/23 ©SAKURA internet Inc. 7 開発にDocker Composeを使う
開発にDocker Composeを使う 8 • 開発環境は⼿元のmacOSなど • いろんな開発を並⾏して⾏うため、環境構築が⼤変 • データベース、Redis、Pythonのバージョン、etc… •
Docker Composeを使うことで簡単に • コンテナを使うため独⽴した環境が⽤意できる • 他の環境に影響しない、壊さない • 初めて実⾏する⼈もコマンド2つ • `docker-compose build` `docker-compose up` のみ • docker-compose.ymlに全て書いてある • 削除も⼀⾏ `docker-compose rm`
開発にDocker Composeを使う 9 • git clone
[email protected]
:isucon/isucon9- portal.git • cd
isucon9-portal • docker-compose build • docker-compose up • http://localhost:8000/ を開く
2019/12/23 ©SAKURA internet Inc. 10 Docker Composeでのデプロイ 〜1台だけで動かす〜
Docker Composeでのデプロイ 11 Docker ComposeとSystemdを使う • パッケージのインストール • docker, docker-compose
• ソースコードを持って来る • docker-compose.yml が含まれている • Systemdにサービス登録する
1台によるDocker Composeでの課題 12 • ソースコード更新の時に、ダウンタイムが発⽣する • イメージビルドや起動にかかる時間による ↓ ローリングアップデート あるいは
ブルー・グリーンデプロイが欲しい
2019/12/23 ©SAKURA internet Inc. 13 Docker Swarm Modeでのデプロイ 〜複数台で動かす〜
Docker Swarm Mode 14 サーバ OS Docker Engine App App
一台でのDocker Compose サーバ サーバ サーバ OS OS OS Docker Engine Docker Engine Docker Engine App App App App App App Docker Cluster 管理レイヤ Docker Swarm Mode オーケストレーション サービス検出・クラスタ管理 Dockerのコンテナ管理
Docker Swarm Modeでのデプロイ 15 • Docker Swarmのインストール • ⼿作業でも簡単 •
Ansibleで⾃動化も簡単 • ソースコードを持って来る • docker stack deploy コマンドで設定を反映 • イメージのバージョンを変えると ローリングアップデートされる!
注意点 16 • 永続化データがあるアプリケーションはコンテナ で実⾏しない • データベースはDocker外で起動する • NFSなどを利⽤する⽅法もある
Docker Swarm ⾃体の使い⽅は… 17 https://www.slideshare.net/zembutsu/introduction-to-docker-swarm
さくらのクラウドで実環境でも使える構成を紹介 18 エンハンスドLB Nginx Swarm Worker Swarm Manager DBアプライアンス スイッチ
192.168.0.0/24 https://www.example.com/ ポート番号毎にアプリケーションをデプロイし、Nginxでリバースプロキシするといい感じ SSLはLet’s Encryptで自動更新! HTTP/2にも対応!
さくらのクラウドで実環境でも使える構成を紹介 19 エンハンスドLB Swarm Worker Swarm Manager DBアプライアンス スイッチ 192.168.0.0/24
https://www.example.com/ ポート番号毎にアプリケーションをデプロイし、ELBのルール機能でリバースプロキシ ルールベースロードバランスに対応!
2019/12/23 ©SAKURA internet Inc. 20 One more thing ...
2019/12/23 ©SAKURA internet Inc. 21 たしかに!
2019/12/23 ©SAKURA internet Inc. 22 さくらのエンジニアリングラボ
2019/12/23 ©SAKURA internet Inc. 23 どんどん新しいサービスをプロトタイピングし 早期のタイミングでお客様にも直接使っていただく
2019/12/23 ©SAKURA internet Inc. 24 わたしも作るか…
2019/12/23 ©SAKURA internet Inc. 25 金曜日
2019/12/23 ©SAKURA internet Inc. 27 土曜日
2019/12/23 ©SAKURA internet Inc. 28 日曜日
2019/12/23 ©SAKURA internet Inc. 29 火曜日
2019/12/23 ©SAKURA internet Inc. 30 先週
2019/12/23 ©SAKURA internet Inc. 31 先週水曜日
2019/12/23 ©SAKURA internet Inc. 32 今日
2019/12/23 ©SAKURA internet Inc. 33 ということは
2019/12/23 ©SAKURA internet Inc. 34 今⽇からさくらのクラウドでご利⽤いただけます
2019/12/23 ©SAKURA internet Inc. 35 今⽇からさくらのクラウドでご利⽤いただけます
2019/12/23 ©SAKURA internet Inc. 36 今⽇のAdvent Calendarで仕組みを紹介しています Private Docker Container
Registryサービスを作った話 https://qiita.com/chibiegg/private/746e0825c602f947ab1c