From b249ce9d91087bc878e1990ef4294b6ad7092f39 Mon Sep 17 00:00:00 2001 From: Emin Arslan Date: Wed, 13 Nov 2024 19:38:13 +0300 Subject: [PATCH] Update the first post --- content/posts/setup_p1.md | 46 ++- content/posts/setup_p2.md | 5 - ...ecfc378fa423ca02a0d5dc3bbc63e6b30d0198.css | 1 - public/index.xml | 2 +- public/posts/docker_setup/index.html | 179 ----------- public/posts/index.html | 2 +- public/posts/index.xml | 2 +- public/posts/podman-setup/index.html | 287 ------------------ public/posts/setup_p1/index.html | 39 ++- public/sitemap.xml | 4 +- 10 files changed, 83 insertions(+), 484 deletions(-) delete mode 100644 content/posts/setup_p2.md delete mode 100644 public/css/main.bundle.min.5636d80e254be9ce31f91d9795aa12f91ebcc8fd4dae961123f822d016b0fe424fdb327be09ddbb563c7dfdcaaecfc378fa423ca02a0d5dc3bbc63e6b30d0198.css delete mode 100644 public/posts/docker_setup/index.html delete mode 100644 public/posts/podman-setup/index.html diff --git a/content/posts/setup_p1.md b/content/posts/setup_p1.md index 367e705..d1600a7 100644 --- a/content/posts/setup_p1.md +++ b/content/posts/setup_p1.md @@ -1,6 +1,6 @@ +++ -title = 'My Setup - p1' -subtitle = 'Containers!' +title = 'My Setup ' +subtitle = 'Containers! Docker!' summary = "I go over the things I've learned about docker, and how I've used it to host my website." date = 2024-10-25T23:11:17+03:00 draft = false @@ -127,3 +127,45 @@ Docker compose helps with this: you can create a `compose.yaml` file, and define containers, ports, volumes, secrets all inside this file. Then, when you run `docker compose up` this configuration is read, and all of it is processed as you would want it to. + +e.g you might have this for starting a web server on port 3000: + +```yaml +services: + web: + image: "nginx" + ports: + - 3000:80 +``` + +Or you could even have *two* servers, like, a gogs and a web server! + +```yaml +services: + web: + image: "nginx" + ports: + - 80:80 + gogs-haha: + image: "gogs/gogs" + ports: + - 3000:3000 + - 3022:22 +``` + +See how we got multiple services to run, very very easily? Isn't that just +really nice? You can just keep adding stuff. And compose even sets up dns for +these containers! That means, for example, you can have your web server act as +a reverse proxy by having it access http://gogs-haha:3000 in the above config! +It just works! + +Of course, you can add volumes to tie it all, and 'secrets' to manage sensitive +files (like keys and certificates). I won't go into those here though. + +# Conclusion + +Docker and Docker Compose are a lot more useful than my younger self would have +given them credit for. It was really fun learning about them, and hopefully I'll +use this knowledge in the future. + +Thank you for reading. diff --git a/content/posts/setup_p2.md b/content/posts/setup_p2.md deleted file mode 100644 index b2aa73d..0000000 --- a/content/posts/setup_p2.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = 'Setup_p2' -date = 2024-10-28T23:41:06+03:00 -draft = true -+++ diff --git a/public/css/main.bundle.min.5636d80e254be9ce31f91d9795aa12f91ebcc8fd4dae961123f822d016b0fe424fdb327be09ddbb563c7dfdcaaecfc378fa423ca02a0d5dc3bbc63e6b30d0198.css b/public/css/main.bundle.min.5636d80e254be9ce31f91d9795aa12f91ebcc8fd4dae961123f822d016b0fe424fdb327be09ddbb563c7dfdcaaecfc378fa423ca02a0d5dc3bbc63e6b30d0198.css deleted file mode 100644 index deb517e..0000000 --- a/public/css/main.bundle.min.5636d80e254be9ce31f91d9795aa12f91ebcc8fd4dae961123f822d016b0fe424fdb327be09ddbb563c7dfdcaaecfc378fa423ca02a0d5dc3bbc63e6b30d0198.css +++ /dev/null @@ -1 +0,0 @@ -/*!Qubt v1.3.2 | MIT License | https://github.com/Chrede88/qubt*//*!tailwindcss v3.4.3 | MIT License | https://tailwindcss.com*/*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}::before,::after{--tw-content:''}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,liberation mono,courier new,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=As]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=as]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=Is]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=is]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *))::before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *))::after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px rgb(var(--tw-prose-kbd-shadows)/10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *))::before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *))::after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *))::before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *))::after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:17 24 39;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgb(0 0 0 / 50%);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-slate{--tw-prose-body:#334155;--tw-prose-headings:#0f172a;--tw-prose-lead:#475569;--tw-prose-links:#6366f1;--tw-prose-bold:#334155;--tw-prose-counters:#64748b;--tw-prose-bullets:#64748b;--tw-prose-hr:#e2e8f0;--tw-prose-quotes:#0f172a;--tw-prose-quote-borders:#e2e8f0;--tw-prose-captions:#64748b;--tw-prose-kbd:#0f172a;--tw-prose-kbd-shadows:15 23 42;--tw-prose-code:#0f172a;--tw-prose-pre-code:#e2e8f0;--tw-prose-pre-bg:#1e293b;--tw-prose-th-borders:#cbd5e1;--tw-prose-td-borders:#e2e8f0;--tw-prose-invert-body:#e2e8f0;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#94a3b8;--tw-prose-invert-links:#6366f1;--tw-prose-invert-bold:#94a3b8;--tw-prose-invert-counters:#94a3b8;--tw-prose-invert-bullets:#e2e8f0;--tw-prose-invert-hr:#334155;--tw-prose-invert-quotes:#f1f5f9;--tw-prose-invert-quote-borders:#334155;--tw-prose-invert-captions:#94a3b8;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#cbd5e1;--tw-prose-invert-pre-bg:rgb(0 0 0 / 50%);--tw-prose-invert-th-borders:#475569;--tw-prose-invert-td-borders:#334155}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-4{bottom:1rem}.right-0{right:0}.top-0{top:0}.top-4{top:1rem}.z-10{z-index:10}.m-0{margin:0}.m-4{margin:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mt-0{margin-top:0}.-mt-0\.5{margin-top:-.125rem}.-mt-6{margin-top:-1.5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mt-1{margin-top:.25rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-48{height:12rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[3px\]{height:3px}.h-\[75vh\]{height:75vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-80{max-height:20rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-2\/5{width:40%}.w-48{width:12rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-screen-lg{max-width:1024px}.max-w-screen-md{max-width:768px}.max-w-screen-xl{max-width:1280px}.shrink-0{flex-shrink:0}.origin-top{transform-origin:top}@keyframes open-menu{0%{transform:scaleY(0)}100%{transform:scaleY(1)}}.animate-open-menu{animation:open-menu .3s ease-in-out forwards}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-flow-row{grid-auto-flow:row}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.grid-cols-none{grid-template-columns:none}.grid-cols-subgrid{grid-template-columns:subgrid}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-center{justify-items:center}.gap-1{gap:.25rem}.gap-8{gap:2rem}.-space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(-.75rem * var(--tw-space-x-reverse));margin-left:calc(-.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border-2{border-width:2px}.border-solid{border-style:solid}.border-slate-50{--tw-border-opacity:1;border-color:rgb(248 250 252/var(--tw-border-opacity))}.bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity))}.bg-neutral-300{--tw-bg-opacity:1;background-color:rgb(212 212 212/var(--tw-bg-opacity))}.bg-slate-700{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity))}.bg-clip-border{background-clip:border-box}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.p-10{padding:2.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-extrabold{font-weight:800}.font-semibold{font-weight:600}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity))}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}.duration-500{transition-duration:500ms}.link{margin:.25rem;height:2.5rem;width:2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y));background-color:transparent;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:300ms;transition-timing-function:cubic-bezier(0,0,.2,1)}@media(hover:hover) and (pointer:fine){.link:hover{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}}.link_svg{border-radius:9999px;fill:#334155}.link_svg:is(.dark *){fill:#f8fafc}.toggle-btn>div::after{--tw-translate-y:0px;--tw-rotate:-45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.toggle-btn>div::before{--tw-translate-y:0px;--tw-rotate:45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.toggle-btn>div{--tw-rotate:720deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y));background-color:transparent}.dark\:prose-invert:is(.dark *){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-kbd:var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows:var(--tw-prose-invert-kbd-shadows);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}.before\:absolute::before{content:var(--tw-content);position:absolute}.before\:h-\[3px\]::before{content:var(--tw-content);height:3px}.before\:w-8::before{content:var(--tw-content);width:2rem}.before\:-translate-x-4::before{content:var(--tw-content);--tw-translate-x:-1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.before\:-translate-y-2::before{content:var(--tw-content);--tw-translate-y:-0.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.before\:-translate-y-2\.5::before{content:var(--tw-content);--tw-translate-y:-0.625rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.before\:rounded::before{content:var(--tw-content);border-radius:.25rem}.before\:bg-slate-700::before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity))}.before\:transition-all::before{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}.before\:duration-500::before{content:var(--tw-content);transition-duration:500ms}.before\:content-\[\'\'\]::before{--tw-content:'';content:var(--tw-content)}.after\:absolute::after{content:var(--tw-content);position:absolute}.after\:h-\[3px\]::after{content:var(--tw-content);height:3px}.after\:w-8::after{content:var(--tw-content);width:2rem}.after\:-translate-x-4::after{content:var(--tw-content);--tw-translate-x:-1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.after\:translate-y-2::after{content:var(--tw-content);--tw-translate-y:0.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.after\:translate-y-2\.5::after{content:var(--tw-content);--tw-translate-y:0.625rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.after\:rounded::after{content:var(--tw-content);border-radius:.25rem}.after\:bg-slate-700::after{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity))}.after\:transition-all::after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}.after\:duration-500::after{content:var(--tw-content);transition-duration:500ms}.after\:content-\[\'\'\]::after{--tw-content:'';content:var(--tw-content)}@media(hover:hover) and (pointer:fine){.hover\:text-indigo-500:hover{--tw-text-opacity:1;color:rgb(99 102 241/var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-indigo-500:hover{text-decoration-color:#6366f1}}.prose-pre\:max-w-\[90vw\] :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){max-width:90vw}.dark\:bg-neutral-500:is(.dark *){--tw-bg-opacity:1;background-color:rgb(115 115 115/var(--tw-bg-opacity))}.dark\:bg-neutral-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(64 64 64/var(--tw-bg-opacity))}.dark\:bg-neutral-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity))}.dark\:bg-slate-200:is(.dark *){--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.dark\:bg-slate-400:is(.dark *){--tw-bg-opacity:1;background-color:rgb(148 163 184/var(--tw-bg-opacity))}.dark\:text-slate-200:is(.dark *){--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity))}.dark\:text-slate-400:is(.dark *){--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.dark\:text-slate-700:is(.dark *){--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity))}.before\:dark\:bg-slate-400:is(.dark *)::before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(148 163 184/var(--tw-bg-opacity))}.after\:dark\:bg-slate-400:is(.dark *)::after{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(148 163 184/var(--tw-bg-opacity))}@media(min-width:768px){.md\:mt-48{margin-top:12rem}.md\:block{display:block}.md\:hidden{display:none}.md\:p-0{padding:0}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-8xl{font-size:6rem;line-height:1}.md\:prose-pre\:max-w-screen-md :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){max-width:768px}}@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}} \ No newline at end of file diff --git a/public/index.xml b/public/index.xml index 785b270..e4ab287 100644 --- a/public/index.xml +++ b/public/index.xml @@ -9,7 +9,7 @@ Fri, 25 Oct 2024 23:11:17 +0300 - My Setup - p1 + My Setup https://emin.software/posts/setup_p1/ Fri, 25 Oct 2024 23:11:17 +0300 https://emin.software/posts/setup_p1/ diff --git a/public/posts/docker_setup/index.html b/public/posts/docker_setup/index.html deleted file mode 100644 index 5efe9fe..0000000 --- a/public/posts/docker_setup/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - -haxala1r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- - - - haxala1r - - -
- - - -
-
- - -
-
- - - - - - - - -
-
-

- -

-

- -

-
- Jan 1, 1 - 0 minute read -
- - - - - - - - -
-
- -
-
-
-
- -

- © - 2024 - Emin Arslan -

- - - - - -

- Published with Hugo & Qubt -

-
- -
- - diff --git a/public/posts/index.html b/public/posts/index.html index 5b38523..c975656 100644 --- a/public/posts/index.html +++ b/public/posts/index.html @@ -155,7 +155,7 @@

- My Setup - p1 + My Setup

I go over the things I’ve learned about docker, and how I’ve used it to host my website. diff --git a/public/posts/index.xml b/public/posts/index.xml index b3249b8..89878d1 100644 --- a/public/posts/index.xml +++ b/public/posts/index.xml @@ -9,7 +9,7 @@ Fri, 25 Oct 2024 23:11:17 +0300 - My Setup - p1 + My Setup https://emin.software/posts/setup_p1/ Fri, 25 Oct 2024 23:11:17 +0300 https://emin.software/posts/setup_p1/ diff --git a/public/posts/podman-setup/index.html b/public/posts/podman-setup/index.html deleted file mode 100644 index 2c54137..0000000 --- a/public/posts/podman-setup/index.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - -haxala1r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
- - - - -
- - - - haxala1r - - -
- - - -
-
- - -
-
- - - - - - - - -
-
-

- My Setup - p1 -

-

- -

-
- Oct 25, 2024 - 5 minute read -
- - - - - - -

Podman

-

In this ‘series’ I will be walking you through my process of how I -host everything on this server.

-

When first creating this website, I just had my blog. I generated this blog -using hugo: a static site generator. Hugo allowed me to -focus on writing whatever I wanted in Markdown format, it would take care of -converting my writing into HTML and CSS.

-

I had a small issue with how I wrote my code and deployed it though: whenever I -made a small change to the page, I had to manually rebuild it, then upload the -updated version to my server and put it in the web directory.

-

This is a cumbersome process. The whole point of using hugo is to focus on the -writing, so having to rebuild and reupload for every typo is… not great. I -wanted to be able to do a simple git push, and not worry about the rest.

-

The previous “manual” approach also depends on me having already installed all -necessary software. If you have a dedicated server that you’re running yourself, -that’s probably okay, you just have to setup once, but I’m running this on a VPS -that I’m not sure I’ll keep forever. The ability to reproduce this exact setup -within minutes actually matters.

-

After reading a bit on this topic, I decided I would use podman for this. Docker would -work just as nicely (any containerization software would work, really), but I decided -on podman because it can run without a daemon and without root privilages. Also, -it has pretty neat support for kubernetes pods (which are honestly a lot more useful -than I would’ve given them credit for before I started this whole project).

-

That’s really why I’m writing this. So that you, the reader (or possibly my future self) can -understand the methodology of podman, how to create pods, run containers and configure all -of this automatically, and so that I may demonstrate and share what I’ve learnt during -this process.

-

Motivation

-

Basically, I’m already running a web server. Why shouldn’t I also host several other services -for friends and family while I’m at it? Why shouldn’t I make the entire setup reproducable?

-

Here are some of the services I wanted to self-host: -- Web server: obviously, who doesn’t want a website? -- Some git server: having my own place to show off all the things I’ve done is certainly really cool. -- Wireguard: Free VPN along with the website? sign me up. -- CI/CD: automatic testing and releases of my software is cool, and also incredibly useful because that’s -how I plan to handle the website as well.

-

Of course, there are always more things I could be self-hosting. So it makes sense to automate -the setup, and that’s where podman comes in.

-

Basics of podman

-

Before we can get to the exciting stuff, we need to go over what podman is, and how to -use it. Essentially, podman is a container engine: it lets you build and run applications in -a containerized environment. Containers are useful because they provide security, -easy setup and most importantly, reproducability.

-

I’m not going to spend any more time explaining what containers are and why they’re -good, that’s been done to death already. Right now, what matters is the actual setup, -so let’s get on with it.

-

If you’ve used docker before, you’ll feel right at home. Many commands are unchanged -from docker, making podman a suitable drop-in replacement. Some things like network -setups tend to be a little different, but that won’t matter too much right now.

-

In case you’re unfamiliar with docker, here are some basic commands:

-
# Search for container images (on docker.io unless you configure otherwise)
-$ podman search <image name>
-
-# Download (pull) an image from remote repo
-$ podman pull <image name>
-
-# list the images you have pulled.
-$ podman images
-
-# run a container.
-$ podman run <image name>
-
-# run a container, but with a LOT of flags. I just listed the most useful ones.
-$ podman run
-    -i # interactive, so you can e.g. run a shell in the container
-    -t # allocates a tty. useful with -i so that shell completion etc. can work
-    -d # opposite of -i, detach and run in the background
-    --port <HOST PORT>:<CONTAINER PORT> # port forwarding, for when you need a server.
-    -v <HOST DIR>:<CONT DIR>:<FLAGS> # give the container access to some directory
-    <image name>
-    <command> # ... want a shell?
-
-# list running containers. add -a to list ALL containers, running or stopped.
-# podman ps <-a>
-
-# stop a running container.
-$ podman stop <id>
-
-# stopped containers don't automatically get removed. This command removes it.
-$ podman rm <id>
-

Pods are nice.

-

Pods are basically just a collection of containers - multiple programs working -with each other.

-

Usually, on a server, each application isn’t totally separate from each other

-
    -
  • for my own usecase, I want my git server (e.g. gogs) to automatically build -and update my website whenever I push to its git repository. That means my git -server and web server can’t be totally separate, there’s some amount of relation. -Pods can help with this.
  • -
-

Pods allow you to create a “pod” containing several containers, sharing resources -with each other, etc. For example, I could run a pod with nginx and gogs running -in seperate containers - then, the nginx server could act as a reverse proxy based -on host name, showing the web page on emin.software, and the git server on -git.emin.software. Nginx redirects to gogs which only binds to the pod’s -localhost address, so only nginx can reach it. Likewise, a database server can -be added to the pod only for the git server to use, so that it can’t be reached -from the outside the pod - and it is logically grouped along with the rest of the pod.

-

On top of this, pods can be built purely from a kubernetes-compatible configuration -file, so setting them up is relatively easy.

- -
-
-
- -
-
-
-
- -

- © - 2024 - Emin Arslan -

- - - - - -

- Published with Hugo & Qubt -

-
- -
- - diff --git a/public/posts/setup_p1/index.html b/public/posts/setup_p1/index.html index 7971cbc..31e43c0 100644 --- a/public/posts/setup_p1/index.html +++ b/public/posts/setup_p1/index.html @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -147,13 +147,13 @@

- My Setup - p1 + My Setup

- Containers! + Containers! Docker!

- Oct 25, 2024 - 5 minute read + Oct 25, 2024 - 6 minute read
@@ -261,6 +261,35 @@ but that’s hardly elegant.

compose.yaml file, and define containers, ports, volumes, secrets all inside this file. Then, when you run docker compose up this configuration is read, and all of it is processed as you would want it to.

+

e.g you might have this for starting a web server on port 3000:

+
services:
+    web:
+        image: "nginx"
+        ports:
+            - 3000:80
+

Or you could even have two servers, like, a gogs and a web server!

+
services:
+    web:
+        image: "nginx"
+        ports:
+            - 80:80
+    gogs-haha:
+        image: "gogs/gogs"
+        ports:
+            - 3000:3000
+            - 3022:22
+

See how we got multiple services to run, very very easily? Isn’t that just +really nice? You can just keep adding stuff. And compose even sets up dns for +these containers! That means, for example, you can have your web server act as +a reverse proxy by having it access http://gogs-haha:3000 in the above config! +It just works!

+

Of course, you can add volumes to tie it all, and ‘secrets’ to manage sensitive +files (like keys and certificates). I won’t go into those here though.

+

Conclusion

+

Docker and Docker Compose are a lot more useful than my younger self would have +given them credit for. It was really fun learning about them, and hopefully I’ll +use this knowledge in the future.

+

Thank you for reading.

diff --git a/public/sitemap.xml b/public/sitemap.xml index 4d22c30..b573815 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -3,10 +3,10 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> https://emin.software/posts/ - 2024-10-28T23:41:06+03:00 + 2024-10-25T23:11:17+03:00 https://emin.software/ - 2024-10-28T23:41:06+03:00 + 2024-10-25T23:11:17+03:00 https://emin.software/posts/setup_p1/ 2024-10-25T23:11:17+03:00