<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Balqis Keyla Ghassani</title>
    <description>The latest articles on DEV Community by Balqis Keyla Ghassani (@balqis_keylaghassani_576).</description>
    <link>https://dev.to/balqis_keylaghassani_576</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4236081%2Fc3a38bdc-4814-4024-88fd-7dfa8074b3c9.png</url>
      <title>DEV Community: Balqis Keyla Ghassani</title>
      <link>https://dev.to/balqis_keylaghassani_576</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/balqis_keylaghassani_576"/>
    <language>en</language>
    <item>
      <title>GlowLog: Building a Skincare Journal with Docker Compose</title>
      <dc:creator>Balqis Keyla Ghassani</dc:creator>
      <pubDate>Tue, 10 Nov 2026 00:47:43 +0000</pubDate>
      <link>https://dev.to/balqis_keylaghassani_576/glowlog-building-a-skincare-journal-with-docker-compose-4hb</link>
      <guid>https://dev.to/balqis_keylaghassani_576/glowlog-building-a-skincare-journal-with-docker-compose-4hb</guid>
      <description>&lt;h2&gt;
  
  
  Why I built this
&lt;/h2&gt;

&lt;p&gt;I buy new skincare products often, and I always forget when I opened them, which ones didn't suit my skin, and when they expire. My notes app was a mess, so I built &lt;strong&gt;GlowLog&lt;/strong&gt;: a small web app to log skincare products, mark whether they work for me, and see which ones expire within 30 days.&lt;/p&gt;

&lt;p&gt;This was my midterm project for a Cloud Services course. The goal was not a big app but a clean &lt;strong&gt;containerized multi-tier setup&lt;/strong&gt;: a web frontend, a REST API, and a database, all running with Docker Compose. I'm aiming for a Cloud/DevOps Engineer role, so this was good practice in packaging, orchestrating, and configuring services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/DRAG_DIAGRAM_SCREENSHOT_HERE" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/DRAG_DIAGRAM_SCREENSHOT_HERE" alt="Architecture diagram" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GlowLog has three containers on one user-defined network:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;app&lt;/strong&gt;: FastAPI serving both the web frontend (HTML, CSS, JavaScript) and the REST API on port 8000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;db&lt;/strong&gt;: PostgreSQL 16.4, reachable only inside the network, with a named volume for its data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;adminer&lt;/strong&gt; (optional): a database viewer that only starts under the &lt;code&gt;tools&lt;/code&gt; profile.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The browser loads the page from &lt;code&gt;app&lt;/code&gt;, JavaScript calls the API with &lt;code&gt;fetch&lt;/code&gt;, and &lt;code&gt;app&lt;/code&gt; talks to the database using the service name &lt;code&gt;db&lt;/code&gt;, not an IP address.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dockerfile
&lt;/h2&gt;

&lt;p&gt;I used a multi-stage build:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; python:3.12.7-slim AS builder
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /build
&lt;span class="k"&gt;COPY&lt;/span&gt; requirements.txt .
&lt;span class="k"&gt;RUN&lt;/span&gt; pip install --no-cache-dir --prefix=/install -r requirements.txt

&lt;span class="k"&gt;FROM&lt;/span&gt; python:3.12.7-slim AS runtime
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; --from=builder /install /usr/local
&lt;span class="k"&gt;COPY&lt;/span&gt; . .
&lt;span class="k"&gt;USER&lt;/span&gt; appuser
&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"uvicorn"&lt;/span&gt;, &lt;span class="s2"&gt;"main:app"&lt;/span&gt;, &lt;span class="s2"&gt;"--host"&lt;/span&gt;, &lt;span class="s2"&gt;"0.0.0.0"&lt;/span&gt;, &lt;span class="s2"&gt;"--port"&lt;/span&gt;, &lt;span class="s2"&gt;"8000"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is simplified. The full file also sets &lt;code&gt;ENV&lt;/code&gt;, &lt;code&gt;EXPOSE&lt;/code&gt;, and creates &lt;code&gt;appuser&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A few choices worth explaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pinned tag&lt;/strong&gt; (&lt;code&gt;3.12.7-slim&lt;/code&gt;, not &lt;code&gt;latest&lt;/code&gt;) so builds are repeatable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependencies are copied before the source code&lt;/strong&gt;, so editing &lt;code&gt;main.py&lt;/code&gt; reuses the cached install layer instead of downloading libraries again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-stage&lt;/strong&gt;: the runtime stage starts clean and only takes the installed packages, so build leftovers never reach the final image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;COPY&lt;/code&gt; instead of &lt;code&gt;ADD&lt;/code&gt;&lt;/strong&gt;, because I don't need URL downloads or automatic tar extraction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exec-form &lt;code&gt;CMD&lt;/code&gt;&lt;/strong&gt; makes uvicorn the main process, so it receives stop signals correctly. &lt;code&gt;--host 0.0.0.0&lt;/code&gt; lets the app be reached from outside the container.&lt;/li&gt;
&lt;li&gt;The app runs as a &lt;strong&gt;non-root user&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final image is about 219MB on disk (53.6MB compressed). Honestly, for a pure-pip Python app the multi-stage savings are modest. The real value is the clean pattern and the &lt;code&gt;slim&lt;/code&gt; base.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Compose
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres:16.4&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pgdata:/var/lib/postgresql/data&lt;/span&gt;
    &lt;span class="na"&gt;healthcheck&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CMD-SHELL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pg_isready -U ${DB_USER} -d ${DB_NAME}"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5s&lt;/span&gt;
      &lt;span class="na"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

  &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./app&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"${APP_PORT}:8000"&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service_healthy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is simplified. The full file also has the network, environment variables, and Adminer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;healthcheck plus &lt;code&gt;service_healthy&lt;/code&gt;&lt;/strong&gt; means the app starts only when PostgreSQL can actually accept connections, not just when its container is running.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;named volume&lt;/strong&gt; keeps data alive when containers are removed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration comes from &lt;code&gt;.env&lt;/code&gt;&lt;/strong&gt;. Only &lt;code&gt;.env.example&lt;/code&gt; is committed, so no secrets reach GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adminer uses a profile&lt;/strong&gt;, so it stays off unless I run &lt;code&gt;docker compose --profile tools up -d&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run it locally
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/keylaghassani1-boop/glowlog.git
&lt;span class="nb"&gt;cd&lt;/span&gt; glowlog
cp .env.example .env   &lt;span class="c"&gt;# then set your own DB_PASSWORD&lt;/span&gt;
docker compose up -d --build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/DRAG_APP_SCREENSHOT_HERE" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/DRAG_APP_SCREENSHOT_HERE" alt="GlowLog app screenshot" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing persistence
&lt;/h2&gt;

&lt;p&gt;I added products, ran &lt;code&gt;docker compose down&lt;/code&gt;, and checked that &lt;code&gt;docker volume ls&lt;/code&gt; still showed &lt;code&gt;glowlog_pgdata&lt;/code&gt;. Then I ran &lt;code&gt;docker compose up -d&lt;/code&gt; and the data was still there. &lt;code&gt;docker compose down -v&lt;/code&gt; would have deleted the volume and wiped the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Containers are temporary, volumes are not. Data has to live in the right place.&lt;/li&gt;
&lt;li&gt;A healthcheck is more reliable than "container started" for service ordering.&lt;/li&gt;
&lt;li&gt;Using service names instead of IPs keeps the setup portable.&lt;/li&gt;
&lt;li&gt;Keeping secrets out of Git is a habit worth starting early.&lt;/li&gt;
&lt;li&gt;Tooling problems are part of the job: before writing any code, I had to get Docker Desktop's engine running on my machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/keylaghassani1-boop/glowlog" rel="noopener noreferrer"&gt;https://github.com/keylaghassani1-boop/glowlog&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo video: PASTE_YOUTUBE_LINK_HERE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;AI disclosure: I used Claude for brainstorming, draft code, and troubleshooting. I reviewed, tested, and ran everything myself.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>cloud</category>
      <category>devops</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
