h5bp / server-configs-nginx

Nginx HTTP server boilerplate configs
MIT License
11.14k stars 1.52k forks source link

Create a h5bp Nginx Dockerfile #42

Closed KyleAMathews closed 10 years ago

KyleAMathews commented 10 years ago

I recently merged in your excellent nginx.conf to my Nginx Docker image. I've been using this image for hosting my blog as I describe here.

It occurred to me that this image / idea is better suited to be developed under the h5bp umbrella. Your mission is roughly to democratize good web practices and it seems a tuned high performance h5bp Nginx Docker image would help. There are growing number of Docker hosting platforms launching. Using them plus the Nginx Docker container couldn't be easier. Load your website files into an image and push to your host.

Thoughts?

AD7six commented 10 years ago

That's an interesting project.

I don't think it fits under h5bp though as docker isn't a mainstream thing (by which I mean, only a small fraction of h5bp's existing users would know of it and even less use it). However as it's a question for h5bp in general: @alrra thoughts?

alrra commented 10 years ago

I recently merged in your excellent nginx.conf to my Nginx Docker image

@KyleAMathews thanks for letting us know about your project!

I don't think it fits under h5bp though as docker isn't a mainstream thing (by which I mean, only a small fraction of h5bp's existing users would know of it and even less use it).

@AD7six I agree. :)

devinrhode2 commented 3 years ago

June 18th 2020 - @ATLSAPI commented:

The same #42 issue was raised over six years ago. Containerisation and Docker are now more mainstream. Should we consider creating one now?

But, @LeoColomb made a good point:

What would provide this kind of image instead of doing it manually? How do you manage required customisation?

It's now been yet another year - I think it's worth re-visiting. This project may serve as an inspiration: https://github.com/bunkerity/bunkerized-nginx (For one, it uses environment variables)

LeoColomb commented 3 years ago

Thanks for comment @devinrhode2. This could be a good idea, but the difficulty of managing customization and host management with a container could be very tricky and is well beyond the scope of this project. It also comes with maintenance costs, which is a big concern for me.

pabl-o-ce commented 1 year ago

Dear friends,

I been using this amazing repo with this config using official nginx:mainline image.

I think the issue is making the documentation for use this repo for nginx docker image.

For now I use like this using docker compose:

1) First step is to set my working directory and add this repo with the path /home/user/nginx/config you will work on that can be used as volume later:

git clone https://github.com/h5bp/server-configs-nginx.git /home/user/nginx/config

I forget on config I just change the user at nginx.conf I set to nginx

2) Second step create a docker compose file or you can do it directly using docker at the path your are working and set the path for the repo as a volume

version: '3'

services:
  nginx:
    container_name: nginx
    hostname: nginx
    restart: unless-stopped
    image: nginx:mainline
    volumes:
      - ./conf:/etc/nginx:rw
      - letsencrypt:/etc/letsencrypt:ro
    ports:
      - 80:80
      - 443:444

Just you need to know how configure the official nginx docker image with this repo.

Hope it help more than one and also any tip/advise/enhancement is well received

:)