rusian/base-nginx

By rusian

Updated about 12 hours ago

Image
0

2.9K

rusian/base-nginx repository overview

Hyperbola Nginx in Docker

This project runs Nginx in a Docker container using Hyperbola GNU/Linux-libre to serve static web content.

Project Structure


.
├── docker-compose.yml
├── nginx/
│   └── default.conf
└── html/
└── index.html

⚙️ Requirements

▶️ Run the Container

To start the service:

docker-compose up

Then access the web server at:

http://localhost:8080

🐙 docker-compose.yml

version: '3.8'

services:
  hyperbola-nginx:
    image: docker.io/rusian/base-nginx:latest
    ports:
      - "8080:80"
    volumes:
      - ./html:/usr/share/nginx/html  # Mount the html directory for static content
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf  # Mount custom nginx config
    environment:
      - NGINX_PORT=80
⚙️ Nginx Configuration (nginx/default.conf)

Create a default.conf file inside the nginx/ directory with the following configuration:

server {
    listen       80;
    listen       [::]:80;
    server_name  localhost;

    location / {
        autoindex on;
        autoindex_exact_size off;
        root   /usr/share/nginx/html;
    }
}

This configuration:

  • Configures Nginx to listen on port 80 for both IPv4 and IPv6.
  • Enables directory listing when no index.html is present in the /usr/share/nginx/html directory.
🌐 html/index.html

Create a simple index.html file inside the html/ directory to verify the server is running:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hyperbola Nginx Server</title>
</head>
<body>
    <h1>Hello from Hyperbola with Nginx in Docker!</h1>
</body>
</html>

🧼 Clean Up

To stop and remove the containers and network:

docker-compose down
✅ Summary
  1. Create the nginx/default.conf and html/index.html files.
  2. Run docker-compose up to start the service.
  3. Visit http://localhost:8080 to see the Nginx server serving static content.

Tag summary

Content type

Image

Digest

sha256:1cbeab1e5

Size

170.3 MB

Last updated

about 12 hours ago

docker pull rusian/base-nginx