<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mokwenyeprosper on Medium]]></title>
        <description><![CDATA[Stories by Mokwenyeprosper on Medium]]></description>
        <link>https://medium.com/@mokwenyeprosper?source=rss-c0626ab21fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Y52wwvRRzyfCeHdd</url>
            <title>Stories by Mokwenyeprosper on Medium</title>
            <link>https://medium.com/@mokwenyeprosper?source=rss-c0626ab21fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:21:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mokwenyeprosper/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Fully Dockerized Mini Job Platform (Flask + MySQL + Nginx)]]></title>
            <link>https://medium.com/@mokwenyeprosper/building-a-fully-dockerized-minijob-platform-flask-mysql-nginx-fa5aa73ef88a?source=rss-c0626ab21fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa5aa73ef88a</guid>
            <dc:creator><![CDATA[Mokwenyeprosper]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 14:48:18 GMT</pubDate>
            <atom:updated>2026-02-17T20:19:04.848Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of my DevOps learning journey, I built a fully containerized Mini Job Board application using Docker and Docker Compose.</p><p>The goal of this project wasn’t just to build another web app.<br>It was to understand how real-world multi-container applications are structured, connected, and managed using core Docker fundamentals.</p><p>📌 What This Project Does</p><p>The MiniJob Platform is a simple job listing web application.</p><p>It allows:</p><p>Users to view job listings from a web page</p><p>A Flask back-end API to serve job data</p><p>A MySQL database to store jobs persistently</p><p>All services to run in isolated Docker containers</p><p>The entire application runs using:</p><pre>docker compose up - build</pre><p>No local MySQL installation.<br>No local Python setup.<br>No dependency conflicts.</p><p>Everything runs inside containers.</p><p>🏗 Architecture Overview</p><pre>minijob-project/<br>│<br>├── backend/<br>│   ├── app.py<br>    ├── requirements.txt<br>│   └── Dockerfile<br>│<br>├── frontend/<br>│   ├── index.html<br>│   └── Dockerfile<br>│<br>├── docker-compose.yml<br>└── README.md</pre><p>This project uses a clean 3-tier architecture:</p><p>How They Communicate</p><p>The browser connects to Nginx</p><p>Nginx serves the static HTML front-end</p><p>The front-end makes API calls to the Flask back-end</p><p>Flask connects to MySQL using environment variables</p><p>MySQL stores job data persistently using Docker volumes</p><p>All services communicate through a custom Docker network called:</p><p>minijob-net</p><p>🐳 Dockerfile Explanation</p><p>I created two Dockerfiles: one for the backend and one for the frontend.</p><p>🧠 Backend Dockerfile (Flask)</p><pre>FROM python:3<br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install - no-cache-dir -r requirements.txt<br>COPY . .<br>EXPOSE 5000<br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>What This Does:</p><p>Uses an official lightweight Python base image</p><p>Sets a working directory inside the container</p><p>Copies and installs dependencies</p><p>Copies the application code</p><p>Exposes port 5000</p><p>Starts the Flask app</p><p>🌐 Front-end Dockerfile (Nginx)</p><pre>FROM nginx:alpine<br>COPY index.html /usr/share/nginx/html/index.html</pre><p>What This Does:</p><p>Uses a lightweight Nginx image</p><p>Replaces the default HTML page</p><p>Serves our custom frontend</p><p>🧩 Docker Compose Breakdown</p><pre>services:<br>db:<br> image: mysql:8.0<br> container_name: minijob-mysql<br> restart: unless-stopped<br> environment:<br> MYSQL_ROOT_PASSWORD: rootpassword<br> MYSQL_DATABASE: minijob<br> MYSQL_USER: minijobuser<br> MYSQL_PASSWORD: minijobpass<br> volumes:<br> - minijob-data:/var/lib/mysql<br> networks:<br> - minijob-net<br>backend:<br> build: ./backend<br> container_name: minijob-backend<br> restart: unless-stopped<br> depends_on:<br> - db<br> networks:<br> - minijob-net<br>frontend:<br> build: ./frontend<br> container_name: minijob-frontend<br> restart: unless-stopped<br> ports:<br> - &quot;8085:80&quot;<br> depends_on:<br> - backend<br> networks:<br> - minijob-net<br>volumes:<br> minijob-data:<br>networks:<br> minijob-net:<br> driver: bridge</pre><p>🔍 What Each Service Does<br>🗄 MySQL Service</p><p>Uses the official MySQL image</p><p>Stores data in a named volume</p><p>Runs inside a custom network</p><p>🧠 Back-end Service</p><p>Builds from the back-end Dockerfile</p><p>Connects to MySQL using environment variables</p><p>Uses container name db as the database host</p><p>Example inside Flask:</p><pre>DB_HOST=db</pre><p>Docker automatically resolves db to the correct container IP.</p><p>🌐 Front-end Service</p><p>Builds from front-end Dockerfile</p><p>Exposes port 8085 to the host machine</p><p>Only the front-end is publicly accessible</p><p>You can access the application at:</p><pre>http://localhost:8085</pre><p>💾 Docker Volumes Explained.</p><p>I used a named volume:</p><pre>minijob-data</pre><p>This volume stores MySQL data.</p><p>Why is this important?</p><p>If the MySQL container is deleted, the database still exists.</p><p>Without volumes:<br>Every restart would erase your data.</p><p>With volumes:<br>Data survives container restarts.</p><p>🌐 Docker Networking Explained</p><p>I created a custom bridge network:</p><pre>minijob-net</pre><p>This allows containers to communicate using service names instead of IP addresses.</p><p>Example:</p><p>DB_HOST=db</p><p>⚠️ Challenges I Faced<br>1 Back-end couldn’t connect to MySQL</p><p>At first, Flask couldn’t connect to the database.</p><p>Solution:</p><p>I ensured both services were on the same network</p><p>I used the container name db as the DB host</p><p>2 Environment Variables Not Loading</p><p>I initially hard-coded database credentials.</p><p>Lesson Learned:</p><p>To always use environment variables for:</p><p>Security</p><p>Flexibility</p><p>Re-usability</p><p>🎯 Lessons Learned</p><p>This project taught me:</p><p>✅ How Docker isolates environments<br>✅ How multi-container applications work<br>✅ How services communicate using networks<br>✅ Why volumes are critical for databases<br>✅ How Docker Compose simplifies orchestration</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa5aa73ef88a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>