88
99
1010
11- < link rel ="canonical " href ="https://explodinglabs.com/superstack/deploying / ">
11+ < link rel ="canonical " href ="https://explodinglabs.com/superstack/deploy / ">
1212
1313
14- < link rel ="prev " href ="../gettingstarted/ ">
15-
1614
1715
1816 < link rel ="icon " href ="../assets/images/favicon.png ">
1917 < meta name ="generator " content ="mkdocs-1.6.1, mkdocs-material-9.6.21 ">
2018
2119
2220
23- < title > Deploying to Remote Environments - SuperStack</ title >
21+ < title > ☁️ Deploying to Remote Environments - SuperStack</ title >
2422
2523
2624
109107 < div class ="md-header__topic " data-md-component ="header-topic ">
110108 < span class ="md-ellipsis ">
111109
112- Deploying to Remote Environments
110+ ☁️ Deploying to Remote Environments
113111
114112 </ span >
115113 </ div >
305303
306304
307305
308-
309-
310-
311-
312- < li class ="md-nav__item md-nav__item--active ">
313-
314- < input class ="md-nav__toggle md-toggle " type ="checkbox " id ="__toc ">
315-
316-
317-
318-
319-
320- < label class ="md-nav__link md-nav__link--active " for ="__toc ">
321-
322-
323306
324- < span class ="md-ellipsis ">
325- Deploying to Remote Environments
326-
327- </ span >
328307
329-
330- < span class ="md-nav__icon md-icon "> </ span >
331- </ label >
332-
333- < a href ="./ " class ="md-nav__link md-nav__link--active ">
308+ < li class ="md-nav__item ">
309+ < a href ="../deploying.md " class ="md-nav__link ">
334310
335311
336312
341317
342318
343319 </ a >
344-
345-
346-
347- < nav class ="md-nav md-nav--secondary " aria-label ="Table of contents ">
348-
349-
350-
351-
352-
353-
354- < label class ="md-nav__title " for ="__toc ">
355- < span class ="md-nav__icon md-icon "> </ span >
356- Table of contents
357- </ label >
358- < ul class ="md-nav__list " data-md-component ="toc " data-md-scrollfix >
359-
360- < li class ="md-nav__item ">
361- < a href ="#1-prepare-your-images " class ="md-nav__link ">
362- < span class ="md-ellipsis ">
363- ✅ 1. Prepare your Images
364- </ span >
365- </ a >
366-
367- </ li >
368-
369- < li class ="md-nav__item ">
370- < a href ="#2-build-and-push-your-images " class ="md-nav__link ">
371- < span class ="md-ellipsis ">
372- 🛠️ 2. Build and Push your Images
373- </ span >
374- </ a >
375-
376- </ li >
377-
378- < li class ="md-nav__item ">
379- < a href ="#3-deploy-the-compose-file " class ="md-nav__link ">
380- < span class ="md-ellipsis ">
381- 📦 3. Deploy the Compose File
382- </ span >
383- </ a >
384-
385- < nav class ="md-nav " aria-label ="📦 3. Deploy the Compose File ">
386- < ul class ="md-nav__list ">
387-
388- < li class ="md-nav__item ">
389- < a href ="#4-set-secrets " class ="md-nav__link ">
390- < span class ="md-ellipsis ">
391- 4. Set Secrets
392- </ span >
393- </ a >
394-
395- </ li >
396-
397- </ ul >
398- </ nav >
399-
400- </ li >
401-
402- < li class ="md-nav__item ">
403- < a href ="#5-launch-your-stack " class ="md-nav__link ">
404- < span class ="md-ellipsis ">
405- 🚀 5. Launch your Stack
406- </ span >
407- </ a >
408-
409- </ li >
410-
411- </ ul >
412-
413- </ nav >
414-
415320 </ li >
416321
417322
443348 < ul class ="md-nav__list " data-md-component ="toc " data-md-scrollfix >
444349
445350 < li class ="md-nav__item ">
446- < a href ="#1-prepare-your-images " class ="md-nav__link ">
447- < span class ="md-ellipsis ">
448- ✅ 1. Prepare your Images
449- </ span >
450- </ a >
451-
452- </ li >
453-
454- < li class ="md-nav__item ">
455- < a href ="#2-build-and-push-your-images " class ="md-nav__link ">
351+ < a href ="#prepare-your-application " class ="md-nav__link ">
456352 < span class ="md-ellipsis ">
457- 🛠️ 2. Build and Push your Images
353+ Prepare your Application
458354 </ span >
459355 </ a >
460356
461357</ li >
462358
463359 < li class ="md-nav__item ">
464- < a href ="#3- deploy-the-compose-file " class ="md-nav__link ">
360+ < a href ="#deploy " class ="md-nav__link ">
465361 < span class ="md-ellipsis ">
466- 📦 3. Deploy the Compose File
362+ 📦 Deploy
467363 </ span >
468364 </ a >
469365
470- < nav class ="md-nav " aria-label ="📦 3. Deploy the Compose File ">
366+ < nav class ="md-nav " aria-label ="📦 Deploy ">
471367 < ul class ="md-nav__list ">
472368
473369 < li class ="md-nav__item ">
474- < a href ="#4-set- secrets " class ="md-nav__link ">
370+ < a href ="#secrets " class ="md-nav__link ">
475371 < span class ="md-ellipsis ">
476- 4. Set Secrets
372+ Secrets
477373 </ span >
478374 </ a >
479375
485381</ li >
486382
487383 < li class ="md-nav__item ">
488- < a href ="#5-launch-your-stack " class ="md-nav__link ">
384+ < a href ="#launch-your-stack " class ="md-nav__link ">
385+ < span class ="md-ellipsis ">
386+ 🚀 Launch your Stack
387+ </ span >
388+ </ a >
389+
390+ </ li >
391+
392+ < li class ="md-nav__item ">
393+ < a href ="#github-actions-workflow " class ="md-nav__link ">
489394 < span class ="md-ellipsis ">
490- 🚀 5. Launch your Stack
395+ Github Actions Workflow
491396 </ span >
492397 </ a >
493398
513418
514419
515420< h1 id ="deploying-to-remote-environments "> ☁️ Deploying to Remote Environments</ h1 >
516- < p > SuperStack is Docker-native, so deployment is simple and portable. Here's how
517- to deploy it to a remote server.</ p >
518- < p > A goal of SuperStack is that only < code > compose.yaml</ code > should be required on the
421+ < p > SuperStack is < strong > Docker-native</ strong > , so deployments are simple, consistent, and
422+ portable. The goal is that only < code > compose.yaml</ code > and secrets need to exist on the
519423remote server.</ p >
520- < h2 id ="1- prepare-your-images " > ✅ 1. Prepare your Images </ h2 >
521- < p > For services that are built (they have a < code > build:</ code > section in < code > compose.yaml</ code > ),
522- add your own container repository image URIs (e.g. your Docker Hub or GitHub
424+ < h2 id ="prepare-your-application " > Prepare your Application </ h2 >
425+ < p > Services that are built (they have a < code > build:</ code > section in < code > compose.yaml</ code > ), add
426+ your own container repository image URIs (e.g. your Docker Hub or GitHub
523427Container Registry account), for example:</ p >
524- < div class ="highlight "> < span class ="filename "> compose.yaml</ span > < pre > < span > </ span > < code > < span class ="nt "> caddy</ span > < span class ="p "> :</ span >
525- < span class ="w "> </ span > < span class ="nt "> build</ span > < span class ="p "> :</ span >
526- < span class ="w "> </ span > < span class ="nt "> context</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ./caddy</ span >
527- < span class ="w "> </ span > < span class ="nt "> image</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ghcr.io/youruser/yourapp-caddy:0.1.0</ span >
528-
529- < span class ="nt "> postgres</ span > < span class ="p "> :</ span >
530- < span class ="w "> </ span > < span class ="nt "> build</ span > < span class ="p "> :</ span >
531- < span class ="w "> </ span > < span class ="nt "> context</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ./postgres</ span >
532- < span class ="w "> </ span > < span class ="nt "> image</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ghcr.io/youruser/yourapp-postgres:0.1.0</ span >
428+ < div class ="highlight "> < span class ="filename "> compose.yaml</ span > < pre > < span > </ span > < code > < span class ="nt "> services</ span > < span class ="p "> :</ span >
429+ < span class ="w "> </ span > < span class ="nt "> caddy</ span > < span class ="p "> :</ span >
430+ < span class ="w "> </ span > < span class ="nt "> build</ span > < span class ="p "> :</ span >
431+ < span class ="w "> </ span > < span class ="nt "> context</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ./caddy</ span >
432+ < span class ="w "> </ span > < span class ="nt "> image</ span > < span class ="p "> :</ span > < span class ="w "> </ span > < span class ="l l-Scalar l-Scalar-Plain "> ghcr.io/youruser/yourapp-caddy:0.1.0</ span >
533433</ code > </ pre > </ div >
534- < h2 id ="2-build-and-push-your-images "> 🛠️ 2. Build and Push your Images</ h2 >
535- < p > Build your images locally and push to your registry:</ p >
434+ < p > Build and push your images:</ p >
536435< div class ="highlight "> < pre > < span > </ span > < code > docker< span class ="w "> </ span > compose< span class ="w "> </ span > build
537436docker< span class ="w "> </ span > compose< span class ="w "> </ span > push
538437</ code > </ pre > </ div >
539- < h2 id ="3- deploy-the-compose-file "> 📦 3. Deploy the Compose File </ h2 >
438+ < h2 id ="deploy "> 📦 Deploy</ h2 >
540439< p > Copy < code > compose.yaml</ code > to the server:</ p >
541440< div class ="highlight "> < pre > < span > </ span > < code > scp< span class ="w "> </ span > compose.yaml< span class ="w "> </ span > youruser@yourserver:
542441</ code > </ pre > </ div >
543- < h3 id ="4-set-secrets "> 4. Set Secrets</ h3 >
544- < p > The stack needs your secrets (passwords, keys, etc.). There are a few options:</ p >
442+ < h3 id ="secrets "> Secrets</ h3 >
443+ < p > The app also needs your secrets (passwords, keys, etc.).</ p >
444+ < p > There are a few options:</ p >
545445< ol >
546- < li > Put secrets in a < code > .env</ code > file on the server. Convenient but Less secure. Be
547- sure to < code > chmod 600 .env</ code > .</ li >
446+ < li > Put secrets in a < code > .env</ code > file on the server, alongside your compose.yaml.
447+ Convenient but Less secure. Be sure to < code > chmod 600 .env</ code > .</ li >
548448< li > Set environment variables in the the < code > docker compose</ code > command. Inconvenient.
549449 Be sure to disable shell history.</ li >
550- < li > Use environment injection in your CI/CD.</ li >
450+ < li > Use environment injection in CI/CD.</ li >
551451</ ol >
552- < h2 id ="5- launch-your-stack "> 🚀 5. Launch your Stack</ h2 >
553- < p > SSH into your server and bring up the stack:</ p >
452+ < h2 id ="launch-your-stack "> 🚀 Launch your Stack</ h2 >
453+ < p > Bring up the stack:</ p >
554454< div class ="highlight "> < pre > < span > </ span > < code > docker< span class ="w "> </ span > compose< span class ="w "> </ span > pull
555455docker< span class ="w "> </ span > compose< span class ="w "> </ span > up< span class ="w "> </ span > -d
556456</ code > </ pre > </ div >
557457< hr />
558458< p > That’s it — your backend is live.</ p >
559- < p > If this is the first time bringing up your stack, the migrations will run
560- automatically. Subsequently, to upgrade your app you should:</ p >
561- < div class ="highlight "> < pre > < span > </ span > < code > docker< span class ="w "> </ span > compose< span class ="w "> </ span > pull
562- docker< span class ="w "> </ span > compose< span class ="w "> </ span > up< span class ="w "> </ span > -d
563- docker< span class ="w "> </ span > compose< span class ="w "> </ span > < span class ="nb "> exec</ span > < span class ="w "> </ span > postgres< span class ="w "> </ span > migrate
564- </ code > </ pre > </ div >
459+ < p > This type of rolling deployment makes it hard to test before going live and to
460+ rollback, and can have some downtime while upgrading. Consider reading the Wiki
461+ page on < a href =""> Advanced Deployments</ a > .</ p >
462+ < h2 id ="github-actions-workflow "> Github Actions Workflow</ h2 >
463+ < p > TODO</ p >
565464
566465
567466
@@ -587,28 +486,6 @@ <h2 id="5-launch-your-stack">🚀 5. Launch your Stack</h2>
587486 < footer class ="md-footer ">
588487
589488
590-
591- < nav class ="md-footer__inner md-grid " aria-label ="Footer " >
592-
593-
594- < a href ="../gettingstarted/ " class ="md-footer__link md-footer__link--prev " aria-label ="Previous: Getting Started ">
595- < div class ="md-footer__button md-icon ">
596-
597- < svg xmlns ="http://www.w3.org/2000/svg " viewBox ="0 0 24 24 "> < path d ="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z "/> </ svg >
598- </ div >
599- < div class ="md-footer__title ">
600- < span class ="md-footer__direction ">
601- Previous
602- </ span >
603- < div class ="md-ellipsis ">
604- Getting Started
605- </ div >
606- </ div >
607- </ a >
608-
609-
610- </ nav >
611-
612489
613490 < div class ="md-footer-meta md-typeset ">
614491 < div class ="md-footer-meta__inner md-grid ">
0 commit comments