Skip to content

Commit

Permalink
a couple of small fixes and latest asciidoctor, first commit from mac
Browse files Browse the repository at this point in the history
  • Loading branch information
hjwp committed Feb 19, 2024
1 parent d429cea commit b4e4a2e
Show file tree
Hide file tree
Showing 23 changed files with 240 additions and 318 deletions.
9 changes: 2 additions & 7 deletions book/appendix_csvs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.16">
<meta name="generator" content="Asciidoctor 2.0.20">
<title>Swapping Out the Infrastructure: Do Everything with CSVs</title>
<style>
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
Expand Down Expand Up @@ -100,11 +100,6 @@

</style>
<style>
pre { line-height: 125%; }
td.linenos .normal { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
pre.pygments .hll { background-color: #ffffcc }
pre.pygments { background: #f0f0f0; }
pre.pygments .tok-c { color: #60a0b0; font-style: italic } /* Comment */
Expand Down Expand Up @@ -518,7 +513,7 @@ <h3 id="_implementing_a_repository_and_unit_of_work_for_csvs"><a class="anchor"
</div>
<div id="footer">
<div id="footer-text">
Last updated 2021-02-26 00:40:46 UTC
Last updated 2023-11-24 02:20:52 UTC
</div>
</div>
<div><div id="disqus_thread" style="margin: 10px"></div>
Expand Down
9 changes: 2 additions & 7 deletions book/appendix_django.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.16">
<meta name="generator" content="Asciidoctor 2.0.20">
<title>Repository and Unit of Work Patterns with Django</title>
<style>
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
Expand Down Expand Up @@ -100,11 +100,6 @@

</style>
<style>
pre { line-height: 125%; }
td.linenos .normal { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
pre.pygments .hll { background-color: #ffffcc }
pre.pygments { background: #f0f0f0; }
pre.pygments .tok-c { color: #60a0b0; font-style: italic } /* Comment */
Expand Down Expand Up @@ -795,7 +790,7 @@ <h3 id="_steps_along_the_way"><a class="anchor" href="#_steps_along_the_way"></a
</div>
<div id="footer">
<div id="footer-text">
Last updated 2021-07-05 09:48:27 +0100
Last updated 2023-11-24 02:20:52 UTC
</div>
</div>
<div><div id="disqus_thread" style="margin: 10px"></div>
Expand Down
4 changes: 2 additions & 2 deletions book/appendix_ds1_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.16">
<meta name="generator" content="Asciidoctor 2.0.20">
<title>Summary Diagram and Table</title>
<style>
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
Expand Down Expand Up @@ -260,7 +260,7 @@ <h2 id="appendix_ds1_table">Appendix A: Summary Diagram and Table<a class="ancho
</div>
<div id="footer">
<div id="footer-text">
Last updated 2021-02-26 00:40:46 UTC
Last updated 2023-11-24 02:20:52 UTC
</div>
</div>
<div><div id="disqus_thread" style="margin: 10px"></div>
Expand Down
61 changes: 28 additions & 33 deletions book/appendix_project_structure.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.16">
<meta name="generator" content="Asciidoctor 2.0.20">
<title>A Template Project Structure</title>
<style>
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
Expand Down Expand Up @@ -100,11 +100,6 @@

</style>
<style>
pre { line-height: 125%; }
td.linenos .normal { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
pre.pygments .hll { background-color: #ffffcc }
pre.pygments { background: #f0f0f0; }
pre.pygments .tok-c { color: #60a0b0; font-style: italic } /* Comment */
Expand Down Expand Up @@ -444,34 +439,34 @@ <h3 id="_docker_compose_and_containers_config"><a class="anchor" href="#_docker_
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="yaml"><span></span><span class="tok-nt">version</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-s">"3"</span><span class="tok-w"></span>
<span class="tok-nt">services</span><span class="tok-p">:</span><span class="tok-w"></span>
<pre class="pygments highlight"><code data-lang="yaml"><span></span><span class="tok-nt">version</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-s">"3"</span>
<span class="tok-nt">services</span><span class="tok-p">:</span>

<span class="tok-w"> </span><span class="tok-nt">app</span><span class="tok-p">:</span><span class="tok-w"> </span>#<b class="conum">(1)</b>
<span class="tok-w"> </span><span class="tok-nt">build</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">context</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">.</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">dockerfile</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">Dockerfile</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">depends_on</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">postgres</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">build</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-nt">context</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">.</span>
<span class="tok-w"> </span><span class="tok-nt">dockerfile</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">Dockerfile</span>
<span class="tok-w"> </span><span class="tok-nt">depends_on</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">postgres</span>
<span class="tok-w"> </span><span class="tok-nt">environment</span><span class="tok-p">:</span><span class="tok-w"> </span>#<b class="conum">(3)</b>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">DB_HOST=postgres</span><span class="tok-w"> </span><b class="conum">(4)</b>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">DB_PASSWORD=abc123</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">API_HOST=app</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">DB_PASSWORD=abc123</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">API_HOST=app</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">PYTHONDONTWRITEBYTECODE=1</span><span class="tok-w"> </span>#<b class="conum">(5)</b>
<span class="tok-w"> </span><span class="tok-nt">volumes</span><span class="tok-p">:</span><span class="tok-w"> </span>#<b class="conum">(6)</b>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">./src:/src</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">./tests:/tests</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">ports</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">./src:/src</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">./tests:/tests</span>
<span class="tok-w"> </span><span class="tok-nt">ports</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-s">"5005:80"</span><span class="tok-w"> </span><b class="conum">(7)</b>


<span class="tok-w"> </span><span class="tok-nt">postgres</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">postgres</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-nt">image</span><span class="tok-p">:</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">postgres:9.6</span><span class="tok-w"> </span>#<b class="conum">(2)</b>
<span class="tok-w"> </span><span class="tok-nt">environment</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">POSTGRES_USER=allocation</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">POSTGRES_PASSWORD=abc123</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-nt">ports</span><span class="tok-p">:</span><span class="tok-w"></span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-s">"54321:5432"</span><span class="tok-w"></span></code></pre>
<span class="tok-w"> </span><span class="tok-nt">environment</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">POSTGRES_USER=allocation</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-l tok-l-Scalar tok-l-Scalar-Plain">POSTGRES_PASSWORD=abc123</span>
<span class="tok-w"> </span><span class="tok-nt">ports</span><span class="tok-p">:</span>
<span class="tok-w"> </span><span class="tok-p tok-p-Indicator">-</span><span class="tok-w"> </span><span class="tok-s">"54321:5432"</span></code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -602,19 +597,19 @@ <h3 id="_dockerfile"><a class="anchor" href="#_dockerfile"></a>Dockerfile</h3>
<span class="tok-c"># RUN apt install gcc libpq (no longer needed bc we use psycopg2-binary)</span>

<b class="conum">(2)</b>
<span class="tok-k">COPY</span><span class="tok-w"> </span>requirements.txt /tmp/
<span class="tok-k">RUN</span><span class="tok-w"> </span>pip install -r /tmp/requirements.txt
<span class="tok-k">COPY</span><span class="tok-w"> </span>requirements.txt<span class="tok-w"> </span>/tmp/
<span class="tok-k">RUN</span><span class="tok-w"> </span>pip<span class="tok-w"> </span>install<span class="tok-w"> </span>-r<span class="tok-w"> </span>/tmp/requirements.txt

<b class="conum">(3)</b>
<span class="tok-k">RUN</span><span class="tok-w"> </span>mkdir -p /src
<span class="tok-k">COPY</span><span class="tok-w"> </span>src/ /src/
<span class="tok-k">RUN</span><span class="tok-w"> </span>pip install -e /src
<span class="tok-k">COPY</span><span class="tok-w"> </span>tests/ /tests/
<span class="tok-k">RUN</span><span class="tok-w"> </span>mkdir<span class="tok-w"> </span>-p<span class="tok-w"> </span>/src
<span class="tok-k">COPY</span><span class="tok-w"> </span>src/<span class="tok-w"> </span>/src/
<span class="tok-k">RUN</span><span class="tok-w"> </span>pip<span class="tok-w"> </span>install<span class="tok-w"> </span>-e<span class="tok-w"> </span>/src
<span class="tok-k">COPY</span><span class="tok-w"> </span>tests/<span class="tok-w"> </span>/tests/

<b class="conum">(4)</b>
<span class="tok-k">WORKDIR</span><span class="tok-w"> </span><span class="tok-s">/src</span>
<span class="tok-k">ENV</span><span class="tok-w"> </span><span class="tok-nv">FLASK_APP</span><span class="tok-o">=</span>allocation/entrypoints/flask_app.py <span class="tok-nv">FLASK_DEBUG</span><span class="tok-o">=</span><span class="tok-m">1</span> <span class="tok-nv">PYTHONUNBUFFERED</span><span class="tok-o">=</span><span class="tok-m">1</span>
<span class="tok-k">CMD</span><span class="tok-w"> </span>flask run --host<span class="tok-o">=</span><span class="tok-m">0</span>.0.0.0 --port<span class="tok-o">=</span><span class="tok-m">80</span></code></pre>
<span class="tok-k">ENV</span><span class="tok-w"> </span><span class="tok-nv">FLASK_APP</span><span class="tok-o">=</span>allocation/entrypoints/flask_app.py<span class="tok-w"> </span><span class="tok-nv">FLASK_DEBUG</span><span class="tok-o">=</span><span class="tok-m">1</span><span class="tok-w"> </span><span class="tok-nv">PYTHONUNBUFFERED</span><span class="tok-o">=</span><span class="tok-m">1</span>
<span class="tok-k">CMD</span><span class="tok-w"> </span>flask<span class="tok-w"> </span>run<span class="tok-w"> </span>--host<span class="tok-o">=</span><span class="tok-m">0</span>.0.0.0<span class="tok-w"> </span>--port<span class="tok-o">=</span><span class="tok-m">80</span></code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -753,7 +748,7 @@ <h3 id="_wrap_up"><a class="anchor" href="#_wrap_up"></a>Wrap-Up</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2021-02-26 00:40:46 UTC
Last updated 2023-11-24 02:20:52 UTC
</div>
</div>
<div><div id="disqus_thread" style="margin: 10px"></div>
Expand Down
Loading

0 comments on commit b4e4a2e

Please sign in to comment.