# Biuro websites

## Information 
- Project repository [dev.biuro](http://git.biuro.lt/biuro/dev.biuro)
- Created from [wordpress-nginx-docker](https://github.com/mjstealey/wordpress-nginx-docker)
- SSL Certificates are created with [SSL For Free](https://www.sslforfree.com/?domains=biuro.lt%20www.biuro.lt%20dev.biuro.lt%20staging.biuro.lt%20biuro.lv%20www.biuro.lv%20dev.biuro.lv%20staging.biuro.lv%20biuro.ee%20www.biuro.ee%20dev.biuro.ee%20staging.biuro.ee)

## Installation 
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop) on your machine
	- Creating new User on my machine helped me with sharing C drive problem (https://tomssl.com/2018/01/11/sharing-your-c-drive-with-docker-for-windows-when-using-azure-active-directory-azuread-aad/) 
- Clone [dev.biuro](http://git.biuro.lt/biuro/dev.biuro) repository
- in Command Prompt run `docker-compose up -d` 
- `docker ps` command should output existing docker containers (nginx, mysql, wordpress)
- restore DB as written in *DB restore* section
- set dev.biuro.lt, dev.biuro.lv, dev.biuro.ee to 127.0.0.1 in hosts
- check if dev.biuro.lt, dev.biuro.lv, dev.biuro.ee works

### DB backup
- `C:\web\dev.biuro> docker exec -i mysql mysqldump -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress > docker/mariadb/db_003.sql`

### DB restore
- `C:\web\dev.biuro> docker exec -i mysql mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress < docker/mariadb/db_002.sql`

## Development 
- `C:\web\dev.biuro\wordpress>yarn (or npm install)`

## Wordpress
- Regions created using [Wordpress Network](https://codex.wordpress.org/Create_A_Network)

### User
- biuro
- laikinas2587 
- info@biuro.eu

### Plugins

### SEO 
- https://docs.google.com/document/d/1FiwVoiLvGGmi9V-HPBgJ3gsh3wGswt27csgvfdTU24w/edit?usp=sharing
- https://docs.google.com/spreadsheets/d/1ggnqKuGxFFkLgI6NDZq4PXpRY_whdHX0kjZj7pCP_fk/edit?ts=5b5eaa62#gid=0
- https://docs.google.com/spreadsheets/d/1dXP0dh_v2sFajrcwR2_9HONMadCdZQW4Y2dVXvhxG3E/edit?ts=5b5eaa6b#gid=748245000

p.s. might not be shared with everyone 




## Known issues (Windows 10)
### Error
ERROR: for mysql  Cannot start service mysql: error while creating mount source path '/host_mnt/c/web/dev.biuro/var/mariadb': mkdir /host_mnt/c: file exists

### Solution
Restart docker



## Other (Commands)
- docker-compose up -d
- docker-compose start
- docker-compose stop

- docker-compose rm -fv

- docker ps

- docker update --restart=no mysql
- docker update --restart=no nginx
- docker update --restart=no wordpress

- docker system prune --all

- docker stop mysql
- docker stop nginx
- docker stop wordpress

- docker restart mysql
- docker restart nginx
- docker restart wordpress

### DB preview
- `docker exec -it mysql bash`
- `mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8`
- `use wordpress;`
- `show tables;`

- `use information_schema;`
- `select * from SCHEMATA;`