Skip to content

Wordpress With Nginx

Wordpress with nginx example

docker-compose.yml

YAML
version: "3.7"
services:

  wp:
    image: wordpress:php8.1-fpm
    container_name: wordpress
    volumes:
      - ./wp-data:/var/www/html
    restart: always
    environment:
      WORDPRESS_DB_HOST: 10.0.50.17
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress

  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    volumes:
      - ./nginx-conf:/etc/nginx/conf.d
      - ./ssl:/etc/nginx/ssl
      - ./wp-data:/var/www/html
    restart: always
    ports:
      - 80:80
      - 443:443