🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Setting Up a Host-Like Environment Using Docker Containers

↗ Quelle (dev.to)
🗣️ Stimme:

Setting Up a Host-Like Environment Using Docker Containers



This documentation provides a step-by-step guide to create a Docker container that mimics a traditional host environment. The container will be capable of running multiple processes and services using supervisord as the process manager.



Features

Nginx: Web server.

MySQL: Database server.

Supervisord: Process manager to manage multiple services.



Host-Like Environment Setup




  1. Create Dockerfile
    Create a Dockerfile with the following content:



CODE
# Use an official Ubuntu base image
FROM ubuntu:latest

# Set environment variables to avoid user prompts during package installations
ENV DEBIAN_FRONTEND=noninteractive

# Update the package list and install necessary packages
RUN apt-get update && apt-get install -y \
nginx \
mysql-server \
supervisor \
&& rm -rf /var/lib/apt/lists/*

# Add supervisor configuration file
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Expose ports for services (e.g., 80 for nginx, 3306 for MySQL)
EXPOSE 80 3306

# Start supervisord to run multiple services
CMD ["/usr/bin/supervisord"]





Explanation:



Base Image: ubuntu:latest provides a minimal Ubuntu environment.

Environment Variables: DEBIAN_FRONTEND=noninteractive ensures package installations don't prompt for user input.

Package Installation: Installs nginx, mysql-server, and supervisor, followed by cleanup to reduce image size.

Configuration: Copies a custom supervisord configuration file into the container.

**Ports: **Exposes necessary ports for Nginx and MySQL.

Entrypoint: Uses supervisord to manage services within the container.




  1. Create supervisord Configuration
    Create a supervisord.conf file with the following content:



CODE
[supervisord]
nodaemon=true

[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autorestart=true

[program:mysql]
command=/usr/sbin/mysqld
autorestart=true





Explanation:



supervisord: Runs in the foreground (nodaemon=true).

Nginx: Configured to run in the foreground (daemon off;) and restart automatically if it fails.

MySQL: Configured to restart automatically if it fails.




  1. Build the Docker Image
    Build the Docker image using the Dockerfile and supervisord configuration:



CODE
docker build -t my_host_like_env .






  1. Run the Docker Container
    Run the Docker container based on the image you just built:



CODE
docker run -d --name my_container -p 80:80 -p 3306:3306 my_host_like_env





Check the container is running using:



docker ps

The output will look something similar like this:





If Nginx is running correctly, this command will fetch the default Nginx welcome page.



Access Nginx logs:




CODE
docker exec -it my_container tail -f /var/log/nginx/access.log








If prompted for a password, the default password is empty (just press Enter). Once connected, you can interact with MySQL as you would on a standard MySQL server.



Access MySQL logs:




CODE
docker exec -it my_container tail -f /var/log/mysql/error.log








Conclusion

You now have a Docker container that simulates a traditional host environment capable of running multiple processes and services. You can extend this setup by adding more services or customizing configurations as per your requirements.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Setting Up a Host-Like Environment Using Docker Containers

Thematisch verwandte Begriffe: Setting, HostLike, Environment, Using · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...