<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0" version="27.2.0">
  <diagram name="Docker Build Flowchart" id="docker-build-flow">
    <mxGraphModel dx="1426" dy="795" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="start" value="Start Docker Build" style="ellipse;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontStyle=1;fontSize=14;" parent="1" vertex="1">
          <mxGeometry x="40" y="40" width="140" height="60" as="geometry" />
        </mxCell>
        <mxCell id="docker-check" value="Check Docker Daemon" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff8f00;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="220" y="50" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="docker-error" value="Error: Docker daemon not running" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffebee;strokeColor=#c62828;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="220" y="120" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="cleanup-start" value="Cleanup Phase" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontStyle=1;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="400" y="50" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="stop-containers" value="Stop &amp; Remove Containers" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="400" y="110" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="remove-volume" value="Remove Docker Volume" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="400" y="160" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="build-start" value="Build Phase" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontStyle=1;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="580" y="50" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="stage1-start" value="Stage 1: Rust Build" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="110" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="rust-base" value="FROM rust:latest" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="160" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="copy-rust" value="COPY ./markdown_backend" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="210" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="install-musl" value="Install musl-tools" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="260" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="cargo-build" value="cargo build --release" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="310" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="stage2-start" value="Stage 2: Node.js Build" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="360" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="node-base" value="FROM node:20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="410" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="copy-package" value="COPY package*.json" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="460" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="npm-install" value="RUN npm install" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="510" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="Baa9tTqOcb9ER4_EkQ3s-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="setup-start">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="700" y="573" as="sourcePoint" />
            <mxPoint x="727.3399999999999" y="70" as="targetPoint" />
            <Array as="points">
              <mxPoint x="730" y="574" />
              <mxPoint x="730" y="70" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="copy-source" value="COPY . ." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="580" y="560" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="setup-start" value="Setup Phase" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontStyle=1;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="750" y="50" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="create-posts" value="Create /app/posts" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="110" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="copy-posts" value="COPY posts/*" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="160" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="copy-binary" value="COPY Rust Binary" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="210" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="set-permissions" value="Set Permissions" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="260" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="npm-build" value="npm run build" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="310" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="create-docker-dir" value="Create /app/docker" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="360" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="set-env" value="ENV DOCKER_CONTAINER=true" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="410" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="expose-port" value="EXPOSE 3000" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="460" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="setup-entrypoint" value="Setup Entrypoint" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="750" y="510" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="build-complete" value="Build Complete" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="930" y="50" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="run-start" value="Run Phase" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff8f00;fontStyle=1;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="930" y="110" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="docker-run" value="docker run" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff8f00;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="170" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="port-mapping" value="Port Mapping 8080:3000" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff8f00;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="220" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="volume-mount" value="Volume Mount" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff8f00;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="270" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="entrypoint-start" value="Entrypoint Execution" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="320" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="check-volume" value="Check Volume Empty?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="370" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="copy-builtin" value="Copy Built-in Posts" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="420" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="start-app" value="Start Application" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=11;" parent="1" vertex="1">
          <mxGeometry x="930" y="470" width="140" height="30" as="geometry" />
        </mxCell>
        <mxCell id="container-running" value="Container Running" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=12;" parent="1" vertex="1">
          <mxGeometry x="930" y="520" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="edge1" parent="1" source="start" target="docker-check" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge2" parent="1" source="docker-check" target="docker-error" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge3" parent="1" source="docker-check" target="cleanup-start" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge4" parent="1" source="cleanup-start" target="stop-containers" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge5" parent="1" source="stop-containers" target="remove-volume" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge6" parent="1" source="remove-volume" target="build-start" edge="1">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="560" y="175" />
              <mxPoint x="560" y="70" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="edge7" parent="1" source="build-start" target="stage1-start" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge8" parent="1" source="stage1-start" target="rust-base" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge9" parent="1" source="rust-base" target="copy-rust" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge10" parent="1" source="copy-rust" target="install-musl" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge11" parent="1" source="install-musl" target="cargo-build" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge13" parent="1" source="stage2-start" target="node-base" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge14" parent="1" source="node-base" target="copy-package" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge15" parent="1" source="copy-package" target="npm-install" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge16" parent="1" source="npm-install" target="copy-source" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge18" parent="1" source="setup-start" target="create-posts" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge19" parent="1" source="create-posts" target="copy-posts" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge20" parent="1" source="copy-posts" target="copy-binary" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge21" parent="1" source="copy-binary" target="set-permissions" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge22" parent="1" source="set-permissions" target="npm-build" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge23" parent="1" source="npm-build" target="create-docker-dir" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge24" parent="1" source="create-docker-dir" target="set-env" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge25" parent="1" source="set-env" target="expose-port" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge26" parent="1" source="expose-port" target="setup-entrypoint" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge27" parent="1" source="setup-entrypoint" target="build-complete" edge="1">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="910" y="525" />
              <mxPoint x="910" y="70" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="edge28" parent="1" source="build-complete" target="run-start" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge29" parent="1" source="run-start" target="docker-run" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge30" parent="1" source="docker-run" target="port-mapping" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge31" parent="1" source="port-mapping" target="volume-mount" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge32" parent="1" source="volume-mount" target="entrypoint-start" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge33" parent="1" source="entrypoint-start" target="check-volume" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge34" parent="1" source="check-volume" target="copy-builtin" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge36" parent="1" source="copy-builtin" target="start-app" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge37" parent="1" source="start-app" target="container-running" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge38" parent="1" source="container-running" edge="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="1000" y="580" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="label1" value="Running" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="1" vertex="1">
          <mxGeometry x="360" y="50" width="40" height="20" as="geometry" />
        </mxCell>
        <mxCell id="label2" value="Not Running" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="1" vertex="1">
          <mxGeometry x="290" y="90" width="50" height="20" as="geometry" />
        </mxCell>
        <mxCell id="label3" value="Empty" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="1" vertex="1">
          <mxGeometry x="1030" y="350" width="30" height="20" as="geometry" />
        </mxCell>
        <mxCell id="label4" value="Not Empty" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="1" vertex="1">
          <mxGeometry x="1030" y="400" width="40" height="20" as="geometry" />
        </mxCell>
        <mxCell id="Baa9tTqOcb9ER4_EkQ3s-2" value="Deployment Done." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e8;strokeColor=#2e7d32;fontSize=12;" vertex="1" parent="1">
          <mxGeometry x="930" y="580" width="140" height="40" as="geometry" />
        </mxCell>
        <mxCell id="Baa9tTqOcb9ER4_EkQ3s-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0.093;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="cargo-build" target="stage2-start">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
