Sign inSign up

mdrideout/ubuntu-nginx

By mdrideout

Updated over 7 years ago
Archived

Ubuntu Bionic, Nginx, PHP 7.3; use phpmyadmin and mysql as separate containers.

Image
0

111

mdrideout/ubuntu-nginx repository overview

Ubuntu Bionic, Nginx, PHP 7.3

This is an nginx web server image designed to be used with docker-compose to build a lemp stack, where mysql and phpmyadmin are separate containers.

Example docker-compose.yaml

  • web server: localhost:8000
  • phpMyAdmin: localhost:8080
version: '3'

services:
  # Mysql Database
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: default
      MYSQL_USER: dbuser
      MYSQL_PASSWORD: dbpass
    networks:
      - lemp-network

  #Ubuntu Nginx PHP
  nginx:
    image: mdrideout/ubuntu-nginx
    restart: always
    volumes:
      - ./html:/var/www/html
    ports: 
      - '8000:80'
      - '8443:443'
    networks:
      - lemp-network

  #phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - '8080:80'
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: root
    networks:
      - lemp-network

networks:
  lemp-network:
volumes:
  db_data:

Database Host

This is the name of the mysql service: db - instead of localhost. For example, use mysql when indicating the database host when setting up WordPress.

Tag summary

Content type

Image

Digest

Size

147.2 MB

Last updated

over 7 years ago

docker pull mdrideout/ubuntu-nginx:bionic