100 Exercises / System Development / 100 Exercise on System Development
Introduction to Git and Docker in Manufacturing | Learning Reproducible Development Environments with Equipment Maintenance Apps
Learn Git, reviews, Python and Node.js environments, Docker, and Compose through ten exercises on reproducible maintenance app development.
Collaborative maintenance app development with Git, isolated environments, and Docker
Keeping a maintenance application useful requires traceable changes, reproducible environments, and a reliable review and release process. These controls let different developers continue improving the application without relying on one person’s PC.
Using a fictional parts factory, exercises No.011–No.020 follow changes from Git history and pull requests through Python and Node.js environment management, configuration, Docker, and Compose startup checks.
About this material This article adapts notebooks used in corporate training by Surikobo or its representative, Hiroshi Wayama, with permission from the participating companies. All data is fictional and does not represent actual companies or factory results.
Introduction: Practical Challenges in Manufacturing Covered in This Article
The target is a fictional company developing equipment inspection and maintenance record apps for use at three factories. Maintenance personnel, information systems departments, and external vendors make changes to the same system. Reasons for equipment shutdown and inspection standards change with improvement activities, so modifications continue even after release.
At this point, what’s important is not the introduction of development tools themselves, but creating a state where you can answer the following questions.
- Can you track changes that caused bugs and approvers?
- Can multiple changes be integrated into units with minimal production impact?
- Can you boot up using the same procedure even if the developer’s PC changes?
- Can connection and secret information be separated from the source code?
- Can APIs, screens, and databases be launched together according to dependencies?
Common situations on site
Files like app_final_v3_fix.py have appeared in the shared folder, and I can’t tell which is the production version. It works on the person in charge’s PC, but on another PC, the library or Node.js version is different and it won’t start. Emergency fixes are directly overwritten into production code, and the reason for the change cannot be explained later. Such issues arise more from lack of design in change management and environmental management than from individual attention.
Why is this issue so difficult to judge?
If control is too strong, even small improvements are delayed; if it is too weak, quality incidents and information leaks increase. Also, the number of Git commits and pull requests is activity, not actual results. You need to combine review wait times, rework rates, environmental differences, and startup success rates to judge Balancing quality, speed, reproducibility, and security.
Exercises covered in this article
| No. | Theme | Key Decisions in Manufacturing |
|---|---|---|
| 011 | Basic Git Operations | Can the change history be used for recovery and auditing? |
| 012 | GitHub Repository | How much to standardize controls in joint development |
| 013 | Branches | How to limit merge conflicts and production impact during parallel development |
| 014 | commit/push/pull | How to design change units and sync frequency |
| 015 | Pull Request | How to balance review quality with wait times |
| 016 | Python Virtual Environment | How to prevent differences in dependent libraries |
| 017 | Node.js environment | How to maintain frontend build reproducibility |
| 018 | .env | How to separate environment-specific settings from confidential information |
| 019 | Docker | How to reduce the feeling of ‘only running on your own PC’ |
| 020 | Docker Compose | How to reliably launch multiple services |
Preparing the Python environment
Without relying on external data, we create fictional development histories and environmental audit data using NumPy, pandas, and matplotlib. Fix the random seed and rerun it so that the result is the same. The settings shown here for Git, GitHub, Docker, etc. are educational examples; in actual organizations, please adjust them according to permission policies, network constraints, and audit requirements.
Show environment setup code
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
from IPython.display import display
import platform
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import japanize_matplotlib
SEED = 42
rng = np.random.default_rng(SEED)
pd.set_option("display.max_columns", 30)
pd.set_option("display.float_format", lambda x: f"{x:,.2f}")
COLORS = ["#4c72b0", "#55a868", "#c44e52", "#8172b3", "#dd8452"]
print(f"Python : {platform.python_version()}")
print(f"NumPy : {np.__version__}")
print(f"pandas : {pd.__version__}")
print(f"matplotlib : {matplotlib.__version__}")
print(f"random numberseed : {SEED}")
Python : 3.14.4
NumPy : 2.5.1
pandas : 3.0.3
matplotlib : 3.11.0
random numberseed : 42
Creation of Fictional Data
Over 12 weeks, eight development members generate a history of revamping five modules: equipment ledger, inspection records, maintenance plans, notifications, and authentication. Each change includes scale, branch strategy, synchronization delays, review methods, conflicts, review waiting, and post-release bugs.
Furthermore, it creates Python dependencies for each PC and Node.js environments, environment variable configuration audits, native and container environment setup trials, and multiple service startup trials. Values are hypothetical values for method explanation.
Show sample-data generation code
n_changes = 180
review_type = rng.choice(
["No reviews", "self-confirmation", "Mutual Review"],
n_changes,
p=[0.12, 0.25, 0.63],
)
strategy = rng.choice(
["maindirectly to", "short-termfeature", "long-termfeature"],
n_changes,
p=[0.15, 0.65, 0.20],
)
files_changed = np.maximum(1, rng.poisson(5, n_changes))
lines_changed = np.maximum(5, np.round(rng.gamma(2.2, 35, n_changes))).astype(int)
sync_delay_h = np.round(rng.gamma(1.7, 5.0, n_changes), 1)
conflict_prob = np.clip(
0.03
+ 0.025 * files_changed
+ 0.012 * sync_delay_h
+ np.where(strategy == "long-termfeature", 0.18, 0)
- np.where(strategy == "short-termfeature", 0.05, 0),
0.02,
0.85,
)
conflict = rng.random(n_changes) < conflict_prob
review_wait_h = np.where(
review_type == "Mutual Review",
rng.gamma(2.0, 5.5, n_changes),
rng.gamma(1.2, 1.2, n_changes),
)
defect_prob = np.clip(
0.025
+ lines_changed / 1500
+ 0.12 * (review_type == "No reviews")
+ 0.05 * (review_type == "self-confirmation")
+ 0.08 * conflict,
0.01,
0.65,
)
changes = (
pd.DataFrame(
{
"change_id": [f"CHG-{i:03d}" for i in range(1, n_changes + 1)],
"date": pd.Timestamp("2026-01-05")
+ pd.to_timedelta(rng.integers(0, 84, n_changes), unit="D"),
"developer": rng.choice([f"DEV-{i:02d}" for i in range(1, 9)], n_changes),
"module": rng.choice(
[
"Equipment Ledger",
"Inspection Records",
"Conservation plan",
"Notice",
"Authentication",
],
n_changes,
),
"strategy": strategy,
"review_type": review_type,
"files_changed": files_changed,
"lines_changed": lines_changed,
"commits": np.maximum(1, rng.poisson(2.2, n_changes)),
"sync_delay_h": sync_delay_h,
"review_wait_h": np.round(review_wait_h, 1),
"conflict": conflict,
"escaped_defect": rng.random(n_changes) < defect_prob,
}
)
.sort_values("date")
.reset_index(drop=True)
)
# Setup trial (assuming the same person tries both native and Docker methods)
setup_rows = []
for trial in range(1, 41):
for method in ["PCDirect Construction", "Docker"]:
if method == "PCDirect Construction":
minutes = max(20, rng.normal(105, 32))
errors = rng.poisson(2.1)
else:
minutes = max(12, rng.normal(38, 10))
errors = rng.poisson(0.45)
setup_rows.append([trial, method, minutes, errors, errors == 0])
setup_trials = pd.DataFrame(
setup_rows, columns=["trial", "method", "setup_minutes", "errors", "first_success"]
)
print(
f"Change History: {len(changes)}records / Developer: {changes.developer.nunique()}name / Eligible Period: {changes.date.min().date()}〜{changes.date.max().date()}"
)
changes.head(6)
Change History: 180records / Developer: 8name / Eligible Period: 2026-01-05〜2026-03-29
| change_id | date | developer | module | strategy | review_type | files_changed | lines_changed | commits | sync_delay_h | review_wait_h | conflict | escaped_defect | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | CHG-072 | 2026-01-05 | DEV-08 | Authentication | long-termfeature | Mutual Review | 5 | 77 | 3 | 7.70 | 13.60 | True | False |
| 1 | CHG-128 | 2026-01-05 | DEV-08 | Notice | short-termfeature | self-confirmation | 8 | 86 | 1 | 6.40 | 1.40 | False | False |
| 2 | CHG-051 | 2026-01-06 | DEV-02 | Inspection Records | maindirectly to | self-confirmation | 6 | 42 | 2 | 7.80 | 1.80 | True | True |
| 3 | CHG-139 | 2026-01-07 | DEV-05 | Equipment Ledger | short-termfeature | Mutual Review | 6 | 36 | 3 | 2.50 | 11.80 | False | False |
| 4 | CHG-063 | 2026-01-07 | DEV-04 | Authentication | short-termfeature | Mutual Review | 3 | 47 | 3 | 10.50 | 7.50 | False | False |
| 5 | CHG-154 | 2026-01-07 | DEV-01 | Equipment Ledger | long-termfeature | Mutual Review | 4 | 79 | 4 | 7.20 | 6.70 | True | False |
No.011: Understanding Basic Git Operations
Practical context
Git records file changes as snapshots and tracks differences from the past and the reasons for changes. When a failure occurs in the facility maintenance app, if you have a change history, you can check “when, who, what, and why it was changed,” and restore the previous state in units with minimal impact.
Design and validation
Basic operations can be organized into the following three layers depending on the work location.
| layer | Main Operations | Implications for decision-making |
|---|---|---|
| work tree | git status, git diff | Check if only the intended changes are |
| Stage and Local History | git add, git commit | Finalize changes in explainable units |
| shared repository | git push, git pull | Synchronize your history with other members. |
Check change traceability as the percentage of change IDs, assignees, target modules, and commit units that are met. This is not about quality itself, but rather a prerequisite KPI necessary for fault investigations and audits.
Check with Python
git_workflow = pd.DataFrame(
{
"sequence": [1, 2, 3, 4, 5, 6],
"command": [
"git status",
"git diff",
"git add <file>",
"git commit",
"git pull --rebase",
"git push",
],
"Confirmation & Operation": [
"Change status",
"Diff Content",
"Select the recording target",
"Confirm local history",
"Import shared history",
"Reflected in Shared History",
],
}
)
display(git_workflow)
traceability = (
pd.Series(
{
"ChangesID": changes.change_id.notna().mean(),
"person in charge": changes.developer.notna().mean(),
"Target Modules": changes.module.notna().mean(),
"Staged with multiple commitments": (changes.commits >= 2).mean(),
}
)
* 100
)
display(traceability.rename("Adequacy Rate (%)").round(1).to_frame())
ax = traceability.plot(kind="bar", color=COLORS[:4], figsize=(8, 4), ylim=(0, 105))
ax.set_title("Change history traceability check")
ax.set_xlabel("Confirmation items")
ax.set_ylabel("Adequacy Rate (%)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=15)
plt.tight_layout()
plt.show()
| sequence | command | Confirmation & Operation | |
|---|---|---|---|
| 0 | 1 | git status | Change status |
| 1 | 2 | git diff | Diff Content |
| 2 | 3 | git add <file> | Select the recording target |
| 3 | 4 | git commit | Confirm local history |
| 4 | 5 | git pull --rebase | Import shared history |
| 5 | 6 | git push | Reflected in Shared History |
| Adequacy Rate (%) | |
|---|---|
| ChangesID | 100.00 |
| person in charge | 100.00 |
| Target Modules | 100.00 |
| Staged with multiple commitments | 63.30 |
Reading the results
Change IDs, contact persons, and target modules can be tracked for all items. On the other hand, “multi-commit stepping” may seem low, but a higher number of commits does not necessarily mean better. The important thing is that each commit serves a single purpose, and the message can explain the reason for the change. To shorten fault response time, link ticket IDs to commits or pull requests, enabling round-trip operations from business requests to production reflection.
No.012: Creating a repository on GitHub
Practical context
GitHub repositories are not just boxes for source code. It is a place that aggregates access rights, issues, pull requests, review history, and protection rules, and controls collaboration between internal teams and external vendors. When handling factory networks or personal information, the scope and permissions of disclosure are determined at the time of creation.
Design and validation
Repository readiness is evaluated using a weighted checklist of 40% security, 30% quality, 20% operations, and 10% handover documentation.
is 1 if set, 0 if not set. The score is not a certification system, but an internal indicator used to visualize any omissions before development begins.
Check with Python
repo_check = pd.DataFrame(
{
"item": [
"privateSetting",
"least privilege",
"mainprotection",
"Required Review",
"Issuetemplate",
"README",
"CODEOWNERS",
"Backup Policy",
],
"Categories": [
"Security",
"Security",
"Quality",
"Quality",
"Utilization",
"handover",
"Quality",
"Utilization",
],
"weight": [25, 15, 12, 10, 10, 10, 8, 10],
"Configured": [1, 1, 1, 1, 1, 1, 0, 0],
}
)
repo_check["Score"] = repo_check["weight"] * repo_check["Configured"]
display(repo_check)
category_score = (
repo_check.groupby("Categories")
.apply(lambda d: 100 * d["Score"].sum() / d["weight"].sum(), include_groups=False)
.sort_values()
)
total_score = 100 * repo_check["Score"].sum() / repo_check["weight"].sum()
print(f"Repository readiness: {total_score:.1f}point / 100point")
ax = category_score.plot(
kind="barh", color=COLORS[: len(category_score)], figsize=(8, 4), xlim=(0, 105)
)
ax.set_title("GitHub readiness by Repository Classification")
ax.set_xlabel("Readiness (%)")
ax.set_ylabel("Categories")
ax.grid(axis="x", alpha=0.3)
plt.tight_layout()
plt.show()
| item | Categories | weight | Configured | Score | |
|---|---|---|---|---|---|
| 0 | privateSetting | Security | 25 | 1 | 25 |
| 1 | least privilege | Security | 15 | 1 | 15 |
| 2 | mainprotection | Quality | 12 | 1 | 12 |
| 3 | Required Review | Quality | 10 | 1 | 10 |
| 4 | Issuetemplate | Utilization | 10 | 1 | 10 |
| 5 | README | handover | 10 | 1 | 10 |
| 6 | CODEOWNERS | Quality | 8 | 0 | 0 |
| 7 | Backup Policy | Utilization | 10 | 0 | 0 |
Repository readiness: 82.0point / 100point
Reading the results
It is important to look not only at the overall score but also at the gaps in classification. In this example, CODEOWNERS and backup policies are not set. For modules that affect equipment shutdowns, maintenance and technical managers are included in the review team, and removal of permissions at the time of retirement or contract termination is also incorporated into operations. By turning the completion conditions for repository creation into checklists, you can reduce control differences between projects.
No.013: Creating and Working with Branches
Practical context
A branch system separates feature additions and emergency fixes while maintaining the main equivalent to production. Even if improvement requests come in from multiple factories simultaneously, you can verify unfinished changes without mixing them into the active version.
Design and validation
For branch strategies, the time it takes to retain changes and the frequency of integration is more important than the name. Long-term branching increases the difference and increases the likelihood of modifying the same file. Here, we aggregate conflict rates, change scale, and synchronization delays by strategy.
Check with Python
branch_kpi = (
changes.groupby("strategy")
.agg(
number_of_changes=("change_id", "count"),
average_line_change=("lines_changed", "mean"),
average_synchronous_latency_h=("sync_delay_h", "mean"),
conflict_rate_pct=("conflict", lambda s: s.mean() * 100),
)
.sort_values("conflict_rate_pct")
)
display(branch_kpi.round(1))
ax = branch_kpi["conflict_rate_pct"].plot(
kind="bar", color=COLORS[:3], figsize=(8, 4)
)
ax.set_title("Merge Conflict Rate by Branch Strategy")
ax.set_xlabel("Branch Strategy")
ax.set_ylabel("Merge Conflict Rate (%)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
| number_of_changes | average_line_change | average_synchronous_latency_h | conflict_rate_pct | |
|---|---|---|---|---|
| strategy | ||||
| maindirectly to | 33 | 71.20 | 9.10 | 21.20 |
| short-termfeature | 110 | 76.50 | 8.20 | 21.80 |
| long-termfeature | 37 | 73.10 | 7.30 | 54.10 |
Reading the results
The generator assigns higher conflict probabilities to long-lived feature branches and longer synchronization delays. The result reflects those assumptions; it does not establish a causal effect of a branching strategy. Split work into small features that span the screen, API, and database, and integrate them frequently. Merge emergency fixes back into the regular development branch as well.
No.014: Using commit, push, and pull
Practical context
commit records changes in explainable units, push shares them, and pull incorporates others’ changes. If you keep changes local, reviews and backups won’t work, and merge conflicts during synchronization will increase.
Design and validation
Synchronization delay is defined as “the time from making a local change to synchronizing with the shared history,” and the relationship with the conflict rate is checked. Correlation does not prove causality, but it can provide clues for reviewing synchronization rules. By simultaneously reviewing the scale of changes, you can avoid competition over just the number of pushes.
Check with Python
changes["sync_delay_band"] = pd.cut(
changes["sync_delay_h"],
bins=[-0.1, 4, 8, 16, np.inf],
labels=["4within the time", "4〜8hours", "8〜16hours", "16time exceed"],
)
sync_kpi = changes.groupby("sync_delay_band", observed=True).agg(
number_of_changes=("change_id", "count"),
average_line_change=("lines_changed", "mean"),
conflict_rate_pct=("conflict", lambda s: s.mean() * 100),
)
display(sync_kpi.round(1))
ax = sync_kpi["conflict_rate_pct"].plot(
kind="line", marker="o", color=COLORS[2], figsize=(8, 4)
)
ax.set_title("Synchronization delays with shared history and conflict rates")
ax.set_xlabel("Time to synchronization")
ax.set_ylabel("Merge Conflict Rate (%)")
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
| number_of_changes | average_line_change | conflict_rate_pct | |
|---|---|---|---|
| sync_delay_band | |||
| 4within the time | 55 | 74.50 | 25.50 |
| 4〜8hours | 51 | 71.60 | 33.30 |
| 8〜16hours | 59 | 77.90 | 25.40 |
| 16time exceed | 15 | 75.10 | 33.30 |
Reading the results
If the slower the sync and the higher the conflict rate, there is room to standardize things like pulls before morning meetings, pushes at the end of work, and sharing during long periods of work. However, you do not push unfinished code directly to the main. Share securely on short-term branches, leaving not only “what you did” but also “why you need it” and change IDs in your commit messages.
No.015: Understanding the Pull Request Process
Practical context
A Pull Request (PR) is a platform where changes are approved by sharing purpose, differences, test results, and scope of impact before integrating changes into the main. If you change the equipment alert threshold, you can check with the staff not only for the correctness of the code but also to ensure there is no increase in false alarms on the shop floor.
Design and validation
For each review method, we compare the post-release defect rate and review waiting time. What should be judged is not “whether to increase or decrease reviews,” but rather the depth and processing capacity of the review according to the risk of change.
Check with Python
review_kpi = (
changes.groupby("review_type")
.agg(
number_of_changes=("change_id", "count"),
average_waiting_time_h=("review_wait_h", "mean"),
issues_with_outflow_rates_pct=("escaped_defect", lambda s: s.mean() * 100),
)
.sort_values("issues_with_outflow_rates_pct")
)
display(review_kpi.round(1))
fig, ax1 = plt.subplots(figsize=(8, 4))
x = np.arange(len(review_kpi))
ax1.bar(
x - 0.18,
review_kpi["issues_with_outflow_rates_pct"],
width=0.36,
color=COLORS[2],
label="issues_with_outflow_rates",
)
ax1.set_ylabel("Defect outflow rate (%)")
ax1.set_xlabel("Review Method")
ax1.set_xticks(x, review_kpi.index)
ax1.grid(axis="y", alpha=0.3)
ax2 = ax1.twinx()
ax2.bar(
x + 0.18,
review_kpi["average_waiting_time_h"],
width=0.36,
color=COLORS[0],
label="average_waiting_time",
)
ax2.set_ylabel("Average Waiting Time (hours)")
ax1.set_title("Quality and Wait Time by Review Method")
fig.legend(loc="upper right", bbox_to_anchor=(0.88, 0.88))
plt.tight_layout()
plt.show()
| number_of_changes | average_waiting_time_h | issues_with_outflow_rates_pct | |
|---|---|---|---|
| review_type | |||
| Mutual Review | 116 | 12.00 | 9.50 |
| self-confirmation | 42 | 1.40 | 9.50 |
| No reviews | 22 | 1.50 | 18.20 |
Reading the results
Mutual reviews help suppress bug leaks while increasing wait times. Authentication with significant suspension impacts, notifications, and database changes are mandatory reviews, while low-risk changes such as wording corrections can be lightened using templates and automated tests. By tracking not only average wait times but also the 90th percentile, reasons for returns, and reviewer bias, you can uncover bottlenecks that are highly personalized.
No.016: Creating a Python Virtual Environment
Practical context
Python’s virtual environment separates libraries and versions for each project. Even on the same PC, updating a data-import job is less likely to break an analysis notebook when each has its own environment.
Design and validation
We compare installing it directly on 8 PCs with creating a virtual environment from a lock file. The number of differences from the base version is used as the environmental drift KPI.
is the version of the PC package, and is the project standard version.
Check with Python
required = {"numpy": "2.5", "pandas": "3.0", "matplotlib": "3.11", "fastapi": "0.116"}
version_options = {
"numpy": ["2.3", "2.4", "2.5"],
"pandas": ["2.2", "3.0"],
"matplotlib": ["3.9", "3.10", "3.11"],
"fastapi": ["0.112", "0.115", "0.116"],
}
env_rows = []
for dev in [f"DEV-{i:02d}" for i in range(1, 9)]:
for package, target in required.items():
system_version = rng.choice(version_options[package])
env_rows.append([dev, package, target, system_version, target])
env_audit = pd.DataFrame(
env_rows,
columns=["developer", "package", "required", "system_install", "virtual_env"],
)
env_audit["system_mismatch"] = env_audit.system_install != env_audit.required
env_audit["venv_mismatch"] = env_audit.virtual_env != env_audit.required
drift = env_audit.groupby("developer")[["system_mismatch", "venv_mismatch"]].sum()
display(drift)
ax = (
drift.mean()
.rename(
{"system_mismatch": "PCdirectly to", "venv_mismatch": "virtual environment"}
)
.plot(kind="bar", color=[COLORS[2], COLORS[1]], figsize=(8, 4))
)
ax.set_title("Dependency version differences per developer")
ax.set_xlabel("Environment Construction Method")
ax.set_ylabel("Differences from baseline (four packages)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
| system_mismatch | venv_mismatch | |
|---|---|---|
| developer | ||
| DEV-01 | 2 | 0 |
| DEV-02 | 2 | 0 |
| DEV-03 | 1 | 0 |
| DEV-04 | 3 | 0 |
| DEV-05 | 4 | 0 |
| DEV-06 | 3 | 0 |
| DEV-07 | 3 | 0 |
| DEV-08 | 4 | 0 |
Reading the results
Combining virtual environments with lock files helps reduce dependency differences within the team. Even if you only create a virtual environment, if you install different versions for each person, you won’t achieve reproducibility. Fix the main Python version, direct dependencies, and indirect dependencies, and regularly test updates as PRs. While leaving room for updates for vulnerability fixes, unplanned automatic updates are avoided.
No.017: Preparing the Node.js development environment
Practical context
Frontends like React are built with Node.js, package managers, and dependency packages. To ensure that the equipment list screen does not yield different results for each developer, the execution environment and dependency resolution are fixed.
Design and validation
This fictional comparison sets Node.js major version 22 and a lock file as requirements, then simulates ten builds on each of twelve PCs. These version numbers are scenario inputs. For an actual project, select a supported version and pin patch versions as well. Check warnings, build duration, and artifact consistency in addition to success rates.
Check with Python
node_rows = []
for dev in [f"DEV-{i:02d}" for i in range(1, 13)]:
node_major = int(rng.choice([20, 22, 23], p=[0.25, 0.60, 0.15]))
lockfile = bool(rng.choice([True, False], p=[0.8, 0.2]))
compliant = node_major == 22 and lockfile
for run in range(10):
success_p = (
0.98 if compliant else (0.88 if node_major == 22 or lockfile else 0.68)
)
node_rows.append(
[dev, node_major, lockfile, compliant, rng.random() < success_p]
)
node_audit = pd.DataFrame(
node_rows,
columns=["developer", "node_major", "lockfile", "compliant", "build_success"],
)
node_audit["Environmental Classification"] = np.where(
node_audit.compliant, "standard conformity", "non-standard"
)
node_kpi = node_audit.groupby("Environmental Classification").agg(
number_of_trials=("build_success", "size"),
build_success_rate_pct=("build_success", lambda s: s.mean() * 100),
)
display(node_kpi.round(1))
ax = node_kpi["build_success_rate_pct"].plot(
kind="bar", color=[COLORS[1], COLORS[2]], figsize=(8, 4), ylim=(0, 105)
)
ax.set_title("Node.js build success rates by environment compatibility")
ax.set_xlabel("Environmental Classification")
ax.set_ylabel("Build success rate (%)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
| number_of_trials | build_success_rate_pct | |
|---|---|---|
| Environmental Classification | ||
| non-standard | 70 | 90.00 |
| standard conformity | 50 | 98.00 |
Reading the results
An environment where the base version and lock files are aligned with the build success rate is stable. Declare the Node.js version with .nvmrc, include package-lock.json and other items in the repository, and perform a clean installation according to the lock file in CI. Migrating to the LTS version involves setting deadlines and responsible persons, updating not only the development PC but also CI, containers, and production build environments simultaneously.
No.018: Managing Environment Variables with .env Files
Practical context
During development, testing, and production, the DB connection destination, log level, and external API destination differ. If these are written directly into the code, misconnections and secret information leaks can occur. Separate code and settings with environment variables, and make .env unmanaged by Git for local development.
Design and validation
The secret values themselves are not handled; instead, they verify “whether the necessary key exists,” “whether the secret information is injected from a secure storage location,” and “whether debugging is disabled in production.” Visualize the set quality as the fulfillment rate of required conditions.
Check with Python
config_audit = pd.DataFrame(
{
"environment": ["Development", "verification", "performance"],
"database_url": [True, True, True],
"app_env": [True, True, True],
"log_level": [True, True, True],
"Injected from secret manager": [False, True, True],
".env excluded from Git": [True, True, True],
"DEBUG disabled": [False, True, True],
}
)
check_cols = config_audit.columns[1:]
config_audit["set_the_fulfillment_rate_pct"] = (
config_audit[check_cols].mean(axis=1) * 100
)
display(config_audit)
ax = config_audit.set_index("environment")["set_the_fulfillment_rate_pct"].plot(
kind="bar", color=COLORS[:3], figsize=(8, 4), ylim=(0, 105)
)
ax.set_title("Configuration Management Check Fulfillment Rate by Environment")
ax.set_xlabel("Environment")
ax.set_ylabel("Set the fulfillment rate (%)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
| environment | database_url | app_env | log_level | Injected from secret manager | .env excluded from Git | DEBUG disabled | set_the_fulfillment_rate_pct | |
|---|---|---|---|---|---|---|---|---|
| 0 | Development | True | True | True | False | True | False | 66.67 |
| 1 | verification | True | True | True | True | True | True | 100.00 |
| 2 | performance | True | True | True | True | True | True | 100.00 |
Reading the results
The development environment scores lower because secret-manager injection and disabled debugging are not enabled in this scenario. Using a local .env file alone does not imply poor configuration. Document permitted differences, keep only names and safe examples in .env.example, and manage production secrets with access controls, rotation, and revocation procedures.
No.019: Understanding the Basics of Docker
Practical context
Docker combines an app, runtime, OS library, and startup command as an image, and starts a container under the same conditions. Compared to directly setting up on different PCs for each factory, we can minimize differences in development, verification, and CI.
Design and validation
With 40 hypothetical setup attempts per method, we compare initial setup time, number of errors, and first-time success rate. Evaluating Docker requires not only average time but also image size, build time, vulnerabilities, and handling of persistent data.
Check with Python
setup_kpi = setup_trials.groupby("method").agg(
number_of_trials=("trial", "count"),
average_preparation_time_min=("setup_minutes", "mean"),
p90_preparation_time_min=("setup_minutes", lambda s: s.quantile(0.9)),
average_number_of_errors=("errors", "mean"),
first_time_success_rate_pct=("first_success", lambda s: s.mean() * 100),
)
display(setup_kpi.round(1))
ax = setup_trials.boxplot(
column="setup_minutes", by="method", grid=False, figsize=(8, 4)
)
ax.set_title("Initial preparation time by environment setup method")
ax.set_xlabel("Environment Construction Method")
ax.set_ylabel("Preparation time (minutes)")
ax.grid(axis="y", alpha=0.3)
plt.suptitle("")
plt.tight_layout()
plt.show()
| number_of_trials | average_preparation_time_min | p90_preparation_time_min | average_number_of_errors | first_time_success_rate_pct | |
|---|---|---|---|---|---|
| method | |||||
| Docker | 40 | 41.60 | 53.10 | 0.60 | 55.00 |
| PCDirect Construction | 40 | 104.60 | 141.20 | 2.00 | 17.50 |
Reading the results
In hypothetical trials, Docker setup time and variation are reduced. However, using Docker does not automatically make it equivalent to a full-scale product. Fix the base image version, avoid unnecessary tools, run it on a non-root user, and scan the image for vulnerabilities. To prevent data loss from the database due to container deletion, separate volumes and backups are designed.
No.020: Launching the Development Environment with Docker Compose
Practical context
Maintenance apps may include not only frontends, APIs, and databases, but also notifications and batches. Docker Compose manages services, networks, volumes, environment variables, and dependencies with a single definition, allowing all team members to launch the same configuration.
Design and validation
Simulate 100 startup attempts per method and compare success rates and recovery times. Short-form depends_on controls startup order. To wait for database readiness, configure a healthcheck and condition: service_healthy. The API also needs to handle connection failures after startup.
Check with Python
services = pd.DataFrame(
{
"service": ["db", "api", "frontend", "worker"],
"depends_on": ["None", "db healthy", "api healthy", "db healthy"],
"healthcheck": ["DBResponse", "/healthResponse", "HTTP 200", "Job Reception"],
"startup_guideline_sec": [18, 12, 8, 10],
}
)
display(services)
startup_rows = []
for method, success_p, recovery_mean in [
("manual work", 0.78, 24),
("Compose+healthcheck", 0.96, 8),
]:
for trial in range(100):
success = rng.random() < success_p
recovery = 0 if success else rng.gamma(2.0, recovery_mean / 2)
startup_rows.append([method, trial, success, recovery])
startup = pd.DataFrame(
startup_rows, columns=["method", "trial", "success", "recovery_minutes"]
)
startup_kpi = startup.groupby("method").agg(
startup_success_rate_pct=("success", lambda s: s.mean() * 100),
average_recovery_on_failure_min=("recovery_minutes", lambda s: s[s > 0].mean()),
)
display(startup_kpi.round(1))
ax = startup_kpi["startup_success_rate_pct"].plot(
kind="bar", color=[COLORS[1], COLORS[3]], figsize=(8, 4), ylim=(0, 105)
)
ax.set_title("Success rates by multi-service startup method")
ax.set_xlabel("Startup Method")
ax.set_ylabel("Startup success rate (%)")
ax.grid(axis="y", alpha=0.3)
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
| service | depends_on | healthcheck | startup_guideline_sec | |
|---|---|---|---|---|
| 0 | db | None | DBResponse | 18 |
| 1 | api | db healthy | /healthResponse | 12 |
| 2 | frontend | api healthy | HTTP 200 | 8 |
| 3 | worker | db healthy | Job Reception | 10 |
| startup_success_rate_pct | average_recovery_on_failure_min | |
|---|---|---|
| method | ||
| Compose+healthcheck | 97.00 | 12.60 |
| manual work | 81.00 | 22.30 |
Reading the results
Combining Compose with health check reduces failures caused by assumptions about startup order. Not only does it ensure the success of the docker compose up, but we also confirm that the API can connect to the database and that business operations can be performed from the screen. Compose for development does not include production secret values; instead, consider another operational platform that meets availability, monitoring, backup, and rolling updates in production.
Design and operational considerations
What can be seen through these 10 is that the development environment is not just a tool for engineers, but a mechanism to control the risks of changes in the manufacturing floor.
- traceability: Linking Git history to change requests, tests, releases, and failures speeds up recovery and auditing.
- Small Integrated Unit: Standardizing short-term branching and synchronization frequency reduces conflicts and rework.
- Risk-Based Review: Do not treat all changes with the same weight; instead, adjust approval conditions according to production, safety, and information risks.
- Coding the environment: Declare versions and configurations for Python, Node.js, containers, and Compose to reduce implicit dependence on personal PCs.
- Separation of Classified Information: Not only removing set values from the code, but also making storage, injection, revocation, and auditing a complete process
These figures are fictional and do not prove the superiority of any particular tool. In your organization, measure the number of failures, change lead times, review waiting periods, inquiries due to environmental factors, and recovery time before and after implementation to confirm the effectiveness of improvements.
Preparing for production
- Boundary of Responsibility: Clarify repository administrators, code owners, release approvers, and contact information in case of failures
- Standard Template: Prepare templates for README, PR, Issue,
.env.example, Dockerfile, Compose, and operating procedures - Automated Inspection: Perform testing, type checking, linter, and dependency vulnerability/secret information scanning with PR
- Production Change Management: Procedural adjustments for release decisions, rollbacks, database migration, and factory downtime
- KPIDesign: Tracking change failure rates, recovery times, lead times, and environment-related issues rather than commit counts
- Education and Exception Handling: Train not only in regular workflows but also in post-review and historical integration during emergency fixes.
Small teams don’t need to adopt a complex branch strategy from the start. Start with main protection, short-term branches, reviews by one or more people, and reproducible startup procedures, then gradually add controls according to regulations, number of sites, and suspension impacts.
Conclusion
From No.011 to No.020, we covered everything from the basics of Git to Docker Compose under one practical challenge: co-developing an equipment maintenance app. Git/GitHub are the foundation for tracking changes and secure integration, the virtual environment and Node.js version management are the foundation for reducing dependency differences, and environment variables and containers are the foundation for reproducing configuration and execution conditions.
The intended result is a release that can be traced to its purpose and approval, an environment another developer can reproduce, and a recovery procedure the team can execute when something fails.
Business inquiries
At Surikobo, we support organizing requirements for manufacturing business systems, designing development standards and Git operations, developing Python/web applications, setting up Docker/CI/CD environments, and integrating with data analysis platforms.
You can consult from stages such as “I want to improve a system that only runs on the person in charge’s PC,” “I want to establish change management including external vendors,” or “I want to make PoC continuously operated at the factory.”
📩 Contact Us: www.surikobo.co.jp/contact
Contact us to discuss your requirements.