Skip to content

Local development environment (install instructions)

Janos Hegymegi edited this page Nov 6, 2019 · 38 revisions

Prerequisite:

  • Install docker and docker-compose.

Steps:

  1. Clone Git repository.
  2. Setup ./wp/nginx-conf (directory and two files in it) and ./wp/.env as explained here.
    • Alternatively, contact us for test files and 1) replace nginx configuration with non-https version and 2) delete server line in the final nginx configuration.
  3. CD into .wp and run docker-compose up -d.
  4. Open a browser and you'll find Wordpress at localhost. Follow the instructions.
  5. Import DB.
    • If you're on Mac, mount new volume for DB dump file by adding the following line to the docker-compose.yml file: ./lahma_db.sql:/var/lib/mysql/lahma_db.sql. Make sure that ./lahma_db.sql is a Lahmacun DB file. Contact us for such a test DB dump.
    • Restart containers: run docker-compose down and docker-compose up -d.
    • SSH into the corresponding container via docker-compose exec db /bin/bash and run cd /var/lib/mysql.
    • Import DB by running mysql -u [DB_USER] -p [DB_NAME] < lahma_db.sql with the corresponding DB user and DB name from .env.
    • Log into mysql shell by mysql -u [DB_USER] -p [DB_NAME] and run
update wp_options set option_value='http://localhost' where option_name='home';
update wp_options set option_value='http://localhost' where option_name='siteurl';

You're ready to go!

Note: pictures will be missing unless you upload them.

Useful commands:

  • select option_value from wp_options where option_name='home';
  • select option_value from wp_options where option_name='siteurl';