Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ wp-content/plugins/hello.php
.idea
.DS_Store

uploads/
initdb.d/
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# bulle.io
# Dismoi.io

Bulle’s Website

## Development

### Development
### Backend

Put your mysql dump in the `initdb.d/` folder.
> It would be loaded when the mysql container start.

If the dump come from production you should clean it first.
Running the following command will replace the domain in any `.sql` file present in `initdb.d/` folder:
```
bin/replace-domain.sh
```

Then start the containers:
```
docker-compose up
```

> A phpmyadmin is available at: http://localhost:8081

> If anything goes wrong, you can try to clean everything docker-compose related:
> ```
> docker-compose rm
> ```

### Frontend
Install NVM. You make need to install node.js 8.9.3 if you dont have it already

Navigate to themes/divi-child-theme. Run `nvm use`
Expand All @@ -13,12 +36,21 @@ Install packages by running `yarn install`

`yarn run watch` for development

`yarn run buld` for production
`yarn run build` for production

## Wordpress migration

1) Download production uploads directory
2) Get production SQL dump
3) Update option_value "siteurl" and "home" in wp_options table
4) Drop assets into the local uploads directory
5) Search and replace in domains in SQL
6) Import modified data dump

`docker-compose up` for docker
More information here -> https://wordpress.org/support/article/moving-wordpress/


### Wishlist
## Wishlist

* Add a Uglification to the CSS output without removing the style header comments

Expand Down
3 changes: 3 additions & 0 deletions bin/replace-domain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
sed -i 's_https://www.dismoi.io_http://localhost:8000_g' ./initdb.d/*.sql
sed -i 's_https://dismoi.io_http://localhost:8000_g' ./initdb.d/*.sql
25 changes: 17 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,39 @@ version: '3.3'

services:
db:
image: mysql:5.7
image: mysql:5.5
volumes:
- db_data:/var/lib/mysql
- ./initdb.d/:/docker-entrypoint-initdb.d/
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

phpmyadmin:
image: phpmyadmin
container_name: phpmyadmin
restart: always
ports:
- 8081:80
environment:
PMA_HOST: db
PMA_USER: wordpress
PMA_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
image: wordpress:5.5.3
ports:
- "8000:80"
- "8000:80" # if port is changed also change it in `bin/replace-domain.sh`
restart: always
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_TABLE_PREFIX: iow_
volumes:
- ./plugins:/var/www/html/wp-content/plugins
- ./themes:/var/www/html/wp-content/themes
volumes:
db_data: {}
- ./uploads:/var/www/html/wp-content/uploads
1 change: 1 addition & 0 deletions initdb.d/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@