How to use Wordpress from Container Podman
Table of Contents
Software required:
- Podman
- Podman Desktop
- Podman compose (https://github.com/containers/podman-compose#installation)
You can refer to my earlier posts where I have install Podman.
Step 1: Create a file compose.yaml
Add this content over it.
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
Step 2: With Podman installed:
Open terminal where you have created the file.
Podman compose is python program so using pip you can install it.
Write this command
$ podman-compose up
You’ll have your Wordpress up and running in port 8080.