Catalogue Website in Docker with OpenTofu
Machen Sie aus der Liste einer Einstellungsdatei eine einseitige Katalog-Website, die nginx in Docker ausliefert, mit Labels „in stock“ oder „sold out“ und geprüften Einstellungen.
- OpenTofu
- Docker provider (kreuzwerker/docker)
- HTTP provider (hashicorp/http)
- nginx (alpine image)
- Docker Desktop
Bildschirmfotos
Einmaliger Preis
- 249 ₹zzgl. GST, insgesamt 293,82 ₹
- 5 $
- Laden Sie es aus Ihrer Bibliothek herunter, sobald Ihre Zahlung bestätigt ist.
- Alle künftigen Releases dieses Projekts sind ohne Aufpreis enthalten.
- Neuestes Release
- 1.0.0 · 29.11.2026
- Lizenz
- Source Code Licence
Überblick
Der vollständige Quellcode einer OpenTofu-Konfiguration, die aus einer Eintragsliste in terraform.tfvars eine einseitige Katalog-Website baut und sie lokal über nginx in Docker ausliefert. Jede Einstellung wird vorab geprüft, Eintragstexte werden für HTML maskiert, tofu apply wartet, bis nginx antwortet, und ein Check bestätigt, dass die Website 200 liefert. Geprüft auf macOS mit Docker Desktop.
Eine Katalogseite ist einmal schnell von Hand geschrieben. Die Seite mit einer Liste, die sich ändert, aktuell zu halten, ohne dass sie kaputtgeht, wenn ein Name ein &-Zeichen enthält, und sie mit einem Befehl zu starten und wieder zu entfernen, erfordert mehr Sorgfalt. Catalogue Website in Docker with OpenTofu® ist genau diese Konfiguration, geprüft in echten Läufen auf macOS mit Docker Desktop.
Was sie macht
- Erstellt die Seite aus Ihrer Liste. Tragen Sie Ihre Einträge in
terraform.tfvarsein, jeweils mit einem Namen, einer optionalen Detailzeile und der Angabe, ob der Eintrag verfügbar ist. Die Seite wird aus einer Vorlage erzeugt, mit dem Label „in stock“ oder „sold out“ hinter jedem Eintrag. - Ein Befehl zum Starten, einer zum Entfernen.
tofu applylädt das offizielle Imagenginx:1.31-alpineherunter und startet den Container.tofu destroyentfernt den Container und das Image. - Ihre Worte, Ihre Labels. Titel, Einleitungszeile und beide Labels sind Einstellungen, sodass derselbe Code Bücher, eine Speisekarte, Produkte oder alles andere auflisten kann.
- Standardmäßig privat. Die Website lauscht auf
127.0.0.1:8080, sodass nur Ihr Computer sie öffnen kann. Eine einzige Einstellung öffnet sie für Ihr Netzwerk.
So gebaut, dass Fehler früh auffallen
- Jede Einstellung wird zuerst geprüft. 1 bis 200 Einträge, eindeutige Namen, Längenbegrenzungen, Port (1024 bis 65535), Adresse und Image werden validiert, bevor etwas erstellt wird, jeweils mit einer klaren Meldung.
- Text kann die Seite nicht kaputt machen. Alle Namen, Details, Titel und Einleitungszeilen werden für HTML maskiert, sodass
Tea & Biscuitsgenau so erscheint, wie es geschrieben ist. - Das Apply wartet auf eine betriebsbereite Website. Ein Health Check im Container fragt bei nginx die Seite ab, und
tofu applyist erst fertig, wenn nginx antwortet. - Ein Check nach jedem Apply. Ein
check-Block ruft die Website ab und warnt, wenn sie nicht mit 200 antwortet.
Code, auf dem Sie aufbauen können
- Klein und lesbar. Sechs kurze
.tf-Dateien mit je einer Aufgabe, dazu die Seitenvorlage und ihr Stylesheet intemplates/. - Ausgaben, die Sie nutzen können. Die Adresse, die Namen aller Einträge und die Namen der verfügbaren Einträge.
- Feste Versionen, reproduzierbare Ergebnisse. Versionsvorgaben für OpenTofu und beide Provider sowie eine Lock-Datei mit Prüfsummen für macOS (Apple Silicon und Intel), Linux (x86-64 und Arm) und Windows.
- Alle Einstellungen in einer Beispieldatei. Kopieren Sie
terraform.tfvars.exampleund ändern Sie, was Sie brauchen.
Was nicht enthalten ist
- Kein Hosting. Die Website läuft auf Ihrem eigenen Computer. Ob sie auf einen Server oder in die Cloud kommt, entscheiden Sie selbst.
- Kein HTTPS. nginx liefert reines HTTP auf dem Port aus, den Sie wählen.
- Kein Shop. Die Konfiguration listet Einträge auf, nimmt aber keine Bestellungen oder Zahlungen an.
In vier Schritten zum Laufen bringen
- Installieren Sie OpenTofu 1.13 oder neuer und starten Sie Docker. Aktivieren Sie auf einem Mac den Standard-Socket von Docker Desktop oder setzen Sie
docker_host. - Entpacken Sie den Download und öffnen Sie ein Terminal in seinem Ordner.
- Führen Sie
tofu initund danntofu applyaus, und geben Sieyesein. - Öffnen Sie
http://127.0.0.1:8080/in Ihrem Browser.
Jeder Schritt mit Screenshots: How to Set Up and Run the Catalogue Website in Docker with OpenTofu (öffnet in einem neuen Tab) (auf Englisch).
Wie der Code die Liste aufbaut, sehen Sie in OpenTofu Tutorial — Part 5: Locals, Expressions and tofu console (öffnet in einem neuen Tab) (auf Englisch), einem Teil des kostenlosen OpenTofu Tutorial for Beginners (öffnet in einem neuen Tab) (auf Englisch).
OpenTofu® ist eine eingetragene Marke von LF Projects, LLC. Docker ist eine Marke von Docker, Inc. Andere Namen sind Marken ihrer jeweiligen Inhaber.
Kostenlose Tutorial-Reihe
OpenTofu Tutorial for Beginners
Sie lernen lieber beim Nachbauen? Diese kostenlose Schritt-für-Schritt-Anleitung in unserem Blog zeigt, wie das Projekt entsteht.
Das bekommen Sie
Alles im Archiv, auf einen Blick.
- Version 1.0.0 des vollständigen Quellcodes: sechs OpenTofu-Dateien, eine Seitenvorlage und ein Stylesheet
- Eine Katalogseite, erzeugt aus einer Liste in terraform.tfvars, mit einer optionalen Detailzeile und dem Label „in stock“ oder „sold out“ für jeden Eintrag
- Geprüfte Einstellungen: 1 bis 200 Einträge, eindeutige Namen, Längenbegrenzungen, Port, Adresse und nginx-Image
- HTML-Maskierung aller Namen, Details, Titel und Einleitungszeilen
- Ein nginx-Container mit Health Check und ein Apply, das wartet, bis die Website antwortet
- Ein check-Block, der nach jedem Apply bestätigt, dass die Website mit 200 antwortet
- Ausgaben mit der Adresse, den Namen aller Einträge und den verfügbaren Einträgen
- Eine Lock-Datei mit Provider-Prüfsummen für macOS, Linux und Windows
- Eine Beispieldatei für die Einstellungen, eine .gitignore und eine .gitattributes-Datei
- Eine README mit Voraussetzungen, allen Einstellungen, den Ausgaben und Fehlerbehebung
Gebaut mit
Die genauen Laufzeitumgebungen und Versionen, mit denen gebaut und getestet wurde.
- OpenTofu1.13.9
- Docker provider (kreuzwerker/docker)4.7.0
- HTTP provider (hashicorp/http)3.6.3
- nginx (alpine image)1.31.10
- Docker Desktop4.100.1
Was im Archiv liegt
Der Dateibaum, den Sie nach dem Entpacken vor sich haben.
catalogue-website-docker-opentofu/
- templates/
- index.html.tftpl
- style.css
- .gitattributes
- .gitignore
- .terraform.lock.hcl
- README.md
- checks.tf
- main.tf
- outputs.tf
- providers.tf
- terraform.tfvars.example
- variables.tf
- versions.tf
Was es von Ihnen braucht
Die Konten und Dienste, die es voraussetzt, damit Sie später nichts überrascht.
- OpenTofu 1.13 oder neuer, unter 2.0
- Docker: Docker Desktop unter macOS oder Windows oder Docker Engine unter Linux
- Auf einem Mac der aktivierte Standard-Socket von Docker Desktop oder die in docker_host gesetzte Docker-Adresse
- Ein freier Port auf Ihrem Computer, standardmäßig 8080
- Ihre Liste von Einträgen (eine Beispielliste einer Buchhandlung ist enthalten)
Versionen
Alle bisherigen Versionen, die neueste zuerst.
1.0.0Neueste
Erstes Release des vollständigen Quellcodes.
- Erstellt einen einseitigen Katalog aus einer Liste in terraform.tfvars und liefert ihn über nginx 1.31 in Docker aus, standardmäßig auf 127.0.0.1:8080.
- Prüft jede Einstellung, bevor etwas erstellt wird, maskiert Eintragstexte für HTML und wartet, bis die Website antwortet.
- Enthält eine Seitenvorlage, ein Stylesheet, eine Beispieldatei für die Einstellungen und eine Lock-Datei für macOS, Linux und Windows.
Source Code Licence
Was Sie damit tun dürfen
What you may and may not do with the source code you buy.
Vollständige Lizenz lesen
- What this licence covers
This licence governs every file included in a product you buy from Dewiride Store: source code, configuration, database scripts, sample data, documentation and any other file in the download. It takes effect when your payment is confirmed and applies to every release of that product that reaches your library. Files that reach your library through an annual updates membership are governed in exactly the same way.
It forms part of the Terms of Sale and Use. Where a product page states different or additional licence terms for that product, those terms prevail for that product. The membership page may likewise state different or additional licence terms for the files a membership carries, and those terms then prevail for those files.
- The licence we grant you
We grant you a perpetual, worldwide, non-exclusive, non-transferable licence to use, reproduce, adapt, translate and modify the files, and to include the result in your own work, on the conditions set out below.
Perpetual means it does not expire. Worldwide means it is not limited to any country. Non-exclusive means we license the same product to other customers. Non-transferable means you cannot pass it on to someone else.
The licence is granted to you — either you personally, or the organisation you identified when buying. Everyone working within that organisation may use the files for that organisation’s projects. Nobody outside it may.
- What you may do
- Use and change the files in your own projects, commercial or otherwise, with no limit on the number of projects.
- Build a product or a service on them and charge your own customers for it.
- Deploy the result for a client, as part of work you are doing for that client.
- Distribute the result in compiled, deployed or otherwise non-source form.
- Keep as many back-up copies as you reasonably need.
- Study, observe and test how the code works, and obtain the information you need to make it work with your own software.
The last two are yours by law under sections 52(1)(aa) to (ac) of the Indian Copyright Act, 1957, and nothing in this licence is intended to take them away.
- What you may not do
- Resell, sublicense, redistribute or publish the files themselves, in whole or in substantial part, in source form.
- Include them in a template, starter kit, course, tutorial repository or component library that you sell or give away, where the code is the thing being supplied.
- Share your account, your download links or your invoices with anyone outside your organisation.
- Publish the files in a public repository, or in any other place where they can be obtained without buying them.
- Remove or obscure the copyright and attribution notices in the source files.
- Use the files to build something whose main purpose is to compete with Dewiride Store as a supplier of the same code.
The distinction that matters is simple: you may sell what you build with the code; you may not sell the code.
- Third-party components
Our products depend on open-source libraries, frameworks and services that we did not write. Those remain under their own licences, which we do not and cannot change. Where a product includes or requires such a component, its licence is named in the product’s documentation, and complying with it is your responsibility.
- Releases
Every release of a product you own is covered by this same licence and appears in your library at no extra cost. A release you have already downloaded remains licensed to you even if we later stop publishing the product. A release that reached your library through an annual updates membership is licensed to you on these same terms, and stays licensed after the period that carried it has ended.
- Ownership
We keep ownership of the files and of the copyright in them. You own whatever you create with them: your changes, your additions and the product you build are yours.
- If this licence ends
This licence ends if you materially breach it and do not put the breach right within thirty days of us asking you to in writing. It also ends if your payment is reversed or refunded, because the purchase it depends on no longer stands. Where a membership period is refunded or reversed, the licence ends for the releases that period carried and for nothing else: anything you bought separately, or that another period carried, is unaffected.
If it ends, you must stop using the files and delete the copies you hold. Work you had already delivered to a client before that point may continue in use, so that ending this licence never breaks something your own customer relies on.
- No warranty beyond the description
The warranties and limits in section 19 and section 20 of the Terms of Sale and Use apply to this licence as well.
- Governing law
This licence is governed by the law of India, and section 24 of the Terms of Sale and Use applies to any dispute about it. If a translation and the English version differ in meaning, the English version governs.
Catalogue Website in Docker with OpenTofu
- 249 ₹zzgl. GST, insgesamt 293,82 ₹
- 5 $