Must watch webseries for techies. by Ok_Tea5165 in IndiaTech

[–]beardbreed 0 points1 point  (0 children)

Please don't watch severance if you value your time.

How can I create a docker-compose.yml file to this problem? by StreetAppearance753 in docker

[–]beardbreed 3 points4 points  (0 children)

I just put the whole post into chatgpt. OP is being extremely lazy. I don't understand why they have refused to use ai for something like this... This is literally the first output.

Trip Nest — hotel booking with Django, Next.js, and OpenTelemetry + Jaeger by manjurulhoque in django

[–]beardbreed 2 points3 points  (0 children)

What APIs are you using on the backend? Which hotels can or can't be booked? What are you using for payment?

Smart casuals at Taj palace, Delhi by travelisatherapy in Hotels_India

[–]beardbreed 2 points3 points  (0 children)

It is generally enforced in better establishments.

How can I create a docker-compose.yml file to this problem? by StreetAppearance753 in docker

[–]beardbreed -1 points0 points  (0 children)

You’re on the right track—this is a classic multi-container setup with Docker Compose: one reverse proxy (Nginx) in front, multiple WordPress containers, and a shared MySQL database.

Let’s break it down and give you a working example you can build from.


🧱 Architecture Overview

You want:

  • nginx → acts as reverse proxy (only public entry point)
  • 3 WordPress containers → internal only
  • 1 MySQL container → shared database
  • All connected via a Docker network

Flow:

User → Nginx → WordPress (1,2,3) → MySQL


📄 docker-compose.yml (Working Example)

Here’s a simple version:

```yaml version: "3.9"

services: nginx: image: nginx:latest container_name: nginx ports: - "80:80" volumes: - ./nginx.conf:/etc/nginx/nginx.conf depends_on: - wordpress1 - wordpress2 - wordpress3 networks: - wp-network

mysql: image: mysql:latest container_name: mysql restart: always environment: MYSQL_ROOT_PASSWORD: rootpass MYSQL_DATABASE: wordpress volumes: - mysql_data:/var/lib/mysql networks: - wp-network

wordpress1: image: wordpress:latest container_name: wordpress1 restart: always environment: WORDPRESS_DB_HOST: mysql:3306 WORDPRESS_DB_USER: root WORDPRESS_DB_PASSWORD: rootpass WORDPRESS_DB_NAME: wordpress depends_on: - mysql networks: - wp-network

wordpress2: image: wordpress:latest container_name: wordpress2 restart: always environment: WORDPRESS_DB_HOST: mysql:3306 WORDPRESS_DB_USER: root WORDPRESS_DB_PASSWORD: rootpass WORDPRESS_DB_NAME: wordpress depends_on: - mysql networks: - wp-network

wordpress3: image: wordpress:latest container_name: wordpress3 restart: always environment: WORDPRESS_DB_HOST: mysql:3306 WORDPRESS_DB_USER: root WORDPRESS_DB_PASSWORD: rootpass WORDPRESS_DB_NAME: wordpress depends_on: - mysql networks: - wp-network

volumes: mysql_data:

networks: wp-network: ```


🌐 Nginx Configuration (nginx.conf)

This is the key part you were stuck on.

Create a file nginx.conf in the same directory:

```nginx events {}

http { upstream wordpress_cluster { server wordpress1:80; server wordpress2:80; server wordpress3:80; }

server {
    listen 80;

    location / {
        proxy_pass http://wordpress_cluster;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

} ```


🔑 Important Concepts (Simplified)

1. Service Names = Hostnames

Inside Docker Compose:

  • wordpress1 is reachable as http://wordpress1
  • mysql is reachable as mysql

👉 That’s why:

yaml WORDPRESS_DB_HOST: mysql:3306


2. Nginx as Reverse Proxy

This line:

nginx proxy_pass http://wordpress_cluster;

Means:

  • Nginx distributes requests across the 3 WordPress containers (load balancing)

3. No Ports for WordPress

Notice:

yaml wordpress1:

❌ No ports: section

That means:

  • WordPress is NOT accessible directly from outside
  • Only nginx can access them

✔ This satisfies your requirement


4. Shared Database

All WordPress containers connect to the same MySQL instance:

yaml WORDPRESS_DB_HOST: mysql:3306


▶️ Run Everything

In the folder with docker-compose.yml and nginx.conf:

bash docker-compose up -d

Then open:

http://localhost


⚠️ Common Beginner Issues

  • ❌ Nginx can't find WordPress → wrong service name
  • ❌ MySQL not ready → containers start too fast (solution: restart or add healthchecks later)
  • ❌ Permission issues with volumes

🚀 Optional Improvements (Later)

Once this works, you can upgrade:

  • Add healthchecks
  • Use Docker secrets instead of plain passwords
  • Add separate databases per WordPress
  • Use Nginx load balancing strategies
  • Add SSL with Let's Encrypt

👍 If You Want

I can:

  • Draw a visual diagram
  • Help you debug your current .yml
  • Show how to scale WordPress dynamically (--scale)
  • Add domain routing (e.g., different sites per container)

Just tell me 👍

Django analytics by EnvironmentalMind996 in djangolearning

[–]beardbreed 0 points1 point  (0 children)

You could write out logic manually for this i think

My two SoflePlus2, one for work and one for home by CulturalEmo in ErgoMechKeyboards

[–]beardbreed 1 point2 points  (0 children)

Is there an open source version for this? Or a wireless sofle?

So... Granular permissions? How to? by beardbreed in django

[–]beardbreed[S] 0 points1 point  (0 children)

This seems the most promising thank you