Giter Club home page Giter Club logo

laradock-wordpress's Introduction

laradock-wordpress

Installation

Add these lines to your hosts file:

127.0.0.1 laradock.test
127.0.0.1 *.laradock.test

This project can be used with any Linux/Mac environment with Docker installed. WSL2 + Docker Desktop is recommended for Windows users.

Prepare WSL2:

PS wsl --set-default-version 2
PS wsl --install --distribution Ubuntu
# Username: user
# Password: secret
PS wsl --set-default Ubuntu
PS wsl -l -v
PS wsl --update
$ sudo apt update && sudo apt upgrade -y

Usage

Enter project folder (for example in WSL2), actual path can be vari depending on your setup

$ cd /mnt/c/www-docker/laradock-wordpress

Copy .env file into it's place:

$ cp .env.example .env

You can define in ./.env file, which web server you want to use, apache2 or nginx. For shared hosting target environment, apache2 is preferred. Another diferrence is, nginx can only host a single site, while apache2 can host multiple sites.

# apache2 or nginx
WEBSERVER=apache2

You also need to define your websites. This is crucial for mass backup & restore shell scripts to work:

SITES=site1,site2
# Examine config
$ ./bin/compose.sh config

# Pull Laradock repository
$ ./bin/compose.sh preinstall

# Start docker-compose
$ ./bin/compose.sh up

# Bootstrap the environment
$ sudo mkdir -p ~/.laradock/backup
$ sudo chown -R $(id -u):$(id -u) ~/.laradock/backup
$ ./bin/compose.sh bootstrap

# Stop the service
$ ./bin/compose.sh down

# Stop the service and destroy everything
$ ./bin/compose.sh prune
# If you want to remove your database and project files, run this command
$ sudo rm -rf ~/.laradock
# To only cleanup Portainer
$ sudo rm -rf ~/.laradock/data/portainer_data

# Backup webserver files & databases
# TODO: copy .htaccess
$ ./bin/compose.sh backup_all

# Restore webserver files & databases
# First, you need to manually delete the project's folder in ~/.laradock/data/html
# then place your backups in ~/.laradock/backup
$ sudo mkdir -p ~/.laradock/backup
$ sudo chown -R $(id -u):$(id -u) ~/.laradock/backup
$ ./bin/compose.sh restore_all

# Backup single website
$ ./bin/backup_single_site.sh -s [sitename]

# Restore single website
$ ./bin/restore_single_site.sh -s [sitename] -l /mnt/[filepath]/backup_[filename].tar.gz

# WP CLI usage
# https://make.wordpress.org/cli/handbook/guides/running-commands-remotely/
$ docker exec laradock-workspace-1 wp --allow-root --help
$ docker exec laradock-workspace-1 wp --allow-root package install wp-cli/restful
$ docker exec laradock-workspace-1 wp --allow-root --http=mesziair.hu --user=mesziair rest user list

FileZilla settings for SFTP access

Create a link which pointing to insecure_id_rsa.ppk key inside Laradock's workspace folder.

FileZilla settings for SFTP access - General tab

FileZilla settings for SFTP access - Advanced tab

URLs

Reading

Laradock: documentation, repository

GitHub issues regarding this project

Self:

Others:

wp-content should be owned by www-data:

WSL2 slow filesystem performance: solution is to copy application files into WSL filesystem.

TODO

  • Implement Ansible deployment to the Raspberry Pi
  • Set UID:GID to 1000 in nginx image
  • Create production build from Laradock
  • Implement Varnish Cache with nginx: Article, Proxy Cache Purge, FakerPress

Misc

# Example to enter a running container
$ docker-compose exec workspace bash
$ docker exec -it {workspace-container-id} bash

GTMetrix optimization guides

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.