User Tools

Site Tools


docker:nginx:docker_compose

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docker:nginx:docker_compose [2025/07/21 08:05] โ€“ created peterdocker:nginx:docker_compose [2025/07/21 08:27] (current) โ€“ peter
Line 1: Line 1:
 ====== Docker - Nginx - Docker Compose ====== ====== Docker - Nginx - Docker Compose ======
 +
 +<code yaml>
 +networks:
 +  webserver:
 +    driver: bridge
 +    ipam:
 +      config:
 +        - subnet: 172.20.0.0/24
 +
 +  webserver:
 +    image: nginx:latest
 +    container_name: webserver
 +    networks:
 +      - webserver
 +    ports:
 +      - 7080:80
 +      - 7443:443
 +    restart: always
 +    volumes:
 +      - $DOCKERDIR/nginx/html:/var/www/html
 +      - $DOCKERDIR/nginx/conf/:/etc/nginx/conf.d/:ro
 +</code>
 +
 +----
 +
 +===== Docker Compose - lscr.io =====
 +
 +<code yaml>
 +---
 +services:
 +  nginx:
 +    image: lscr.io/linuxserver/nginx:latest
 +    container_name: nginx
 +    environment:
 +      - PUID=1000
 +      - PGID=1000
 +      - TZ=Etc/UTC
 +      - NGINX_AUTORELOAD= #optional
 +      - NGINX_AUTORELOAD_WATCHLIST= #optional
 +    volumes:
 +      - /path/to/nginx/config:/config
 +    ports:
 +      - 80:80
 +      - 443:443
 +    restart: unless-stopped
 +</code>
 +
 +----
 +
 +===== Link with PHP =====
 +
 +<code yaml>
 +version: '3'
 +services:
 +  web:
 +    image: nginx:latest
 +    ports:
 +      - "8080:80"
 +    volumes:
 +      - ./src:/usr/share/nginx/html
 +    links:
 +      - php
 +  php:
 +    image: php:7-fpm
 +</code>
 +
 +<WRAP info>
 +**NOTE:**
 +
 +  * **php** โ€“ It will download php-fpm image, create a container and link it with the Nginx container.
 +
 +</WRAP>
 +
 +----
 +
 +===== References =====
 +
 +https://docs.linuxserver.io/images/docker-nginx
  
docker/nginx/docker_compose.1753085107.txt.gz ยท Last modified: 2025/07/21 08:05 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki