Skip to content

Instantly share code, notes, and snippets.

@tim-hub
Created April 15, 2023 03:31
Show Gist options
  • Save tim-hub/ba83f86f5fe7b4a283c0f93f465ccbad to your computer and use it in GitHub Desktop.
Save tim-hub/ba83f86f5fe7b4a283c0f93f465ccbad to your computer and use it in GitHub Desktop.
docker compose file to start a wordpress blog in one go.
version: '3'
services:
# Database
db:
image: mariadb:latest
volumes:
- db_volume:/var/lib/mysql
- ./wp/db:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wpsite
# Wordpress
wordpress:
depends_on:
- db
image: bitnami/wordpress-nginx:latest
ports:
- '8000:8080'
restart: always
volumes:
- wp_volume1:/bitnami
- ./wp/files:/bitnami
environment:
- WORDPRESS_DATABASE_HOST=db
- WORDPRESS_DATABASE_PORT_NUMBER=3306
- WORDPRESS_DATABASE_USER=wordpress
- WORDPRESS_DATABASE_PASSWORD=wordpress
- WORDPRESS_DATABASE_NAME=wordpress
networks:
- wpsite
# FTP is not more required for plugin and theme update in wordpress now
# ftp:
# container_name: ftpd-server
# image: crazymax/pure-ftpd:1.0.50
# depends_on:
# - wordpress
# ports:
# - "21:21"
# - "20:20"
# - 30000-30009:30000-30009
# volumes:
# - wp_volume1:/home/user/:rw
# - './ftp/pass:/etc/pure-ftpd/passwd'
# environment:
# PUBLICHOST: "localhost"
# FTP_USER_NAME: "user"
# FTP_USER_PASS: password
# FTP_USER_HOME: "/home/user"
# FTP_USER_UID: 33
# FTP_USER_GID: 33
# ADDED_FLAGS: "--tls=2"
# TLS_CN: "**** FTP"
# TLS_ORG: "*****"
# TLS_C: "US"
# MAX_CONNECTIONS: "20"
# restart: always
#
# networks:
# - wpsite
networks:
wpsite:
volumes:
db_volume:
driver: local
wp_volume1:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment