# Docker Containers ready for Development

## Authors

#--------------------------------------------------------------------
#Solido DAMP V1.0: Dev stack for Prestashop / Wordpress
#Based on dev-docker-apache2.4-php8-mariadb10.1 #https://github.com/Pixelao/dev-docker-apache2.4-php8-mariadb10.1
#LABEL MAINTAINER="Adrián Martín Ramos <contacto@adrianmr.com>"

## Version History

- **0.1**
  \_ Initial Release
  ##Contributors
  _it@solido.com 2024
  #--------------------------------------------------------------------

### Dependencies and needs

- [Install Docker](https://docs.docker.com/install/)
- [Install Docker Compose](https://docs.docker.com/compose/install/)

### Installing

- First, clone or download the project on your local dev environement
- Edit your local host file and add your local domain name ex : myshop.local
- Find it on /tec/host linux, Mac os
- Edit the .env at top of the container
- ENV=dev
- IP=127.0.0.1 -> localhost IP by default
- PROJECT=myshop -> project name
- DOMAIN=myshop.local -> your local domain name
- CMS=prestashop -> choose your CMS installation
- #CMS=wordpress -> or comment
- PHPVERSION=8.1 -> select wich PHP
- CMSVERSION=8.1.2 -> selet CMS version

- Start the containers with command:
  ```bash
  dmake ENV=dev docker-build
  ```

### Help

The docker-project is based on 3 containers

- skeleton-docker.apache **(Apache 2.4, container image httpd:2.4-alpine)**
- skeleton-docker.php **(PHP-{PHPVERSION}, container image php:{PHPVERSION}-fpm-alpine)**
- skeleton-docker.mariadb **(MariaDb 10.1, container image mariadb:10.1)**

You can check Apache and PHP logs on volume/logs\_\_

### Versions and modules

- [Apache-2.4](https://httpd.apache.org/docs/2.4/en/)
- [MariaDB-10.1](https://downloads.mariadb.org/mariadb/10.1.41/)
- [PHP-{PHPVERSION}-FPM](https://www.php.net/ChangeLog-{PHPVERSION}.php)

  - [PHP Modules]

    - bcmath
    - Core
    - ctype
    - curl
    - date
    - dom
    - exif
    - fileinfo
    - filter
    - ftp
    - gd
    - hash
    - iconv
    - intl
    - json
    - libxml
    - mbstring
    - mysqli
    - mysqlnd
    - openssl
    - pcre
    - PDO
    - pdo_mysql
    - pdo_pgsql
    - pdo_sqlite
    - Phar
    - posix
    - rar
    - readline
    - redis
    - Reflection
    - session
    - SimpleXML
    - soap
    - sodium
    - SPL
    - sqlite3
    - standard
    - tokenizer
    - xdebug
    - xml
    - xmlreader
    - xmlwriter
    - xsl
    - Zend OPcache
    - zip
    - zlib

  - [Zend Modules]
    - Xdebug
    - Zend OPcache

#--------------------------------------------------------------------

# Make actions list

#--------------------------------------------------------------------

# Build the infrastructure

```
make ENV=dev docker-build (use docker-compose.dev.yml)
```

# Database tools

## Configure backup & restore feature

```
make ENV=dev config-db-root
```

## You can import your database with :

##It will restore the db using `backup/db.sql` file.
##(You may need to manually empty the database if your file does not contain remove table commands)

```
make ENV=dev db-restore
```

## You can export your database with :

```
make ENV=dev db-backup
```

# Create or recreate your SSL keys

```
make ENV=dev init-ssl
```

# Manage Docker containers

```
make ENV=dev docker-restart
```

```
 make ENV=dev docker-start
```

```
make ENV=dev docker-stop
```

## Install Prestashop or Wordpress with Bedrock achitecture depending of the top .env file

```
make ENV=dev dget-cms
```

#--------------------------------------------------------------------

# Prestashop

#--------------------------------------------------------------------

```
Prestashop install with install-cli.php
* ENV default parameters *
  --db_server=127.0.0.1
	--db_name=database
	--db_user=user
	--db_password=password
*

* You can acces Prestashop bo with your https://yourlocaldomainname/administrator
* user and password defined in .env top file

* We use the Oxydan falcon theme at https://github.com/Oksydan/falcon
* and a child theme myshop-theme
* Refer to the Oxydan Falcon theme read-me to start your theme development
*
* Edit /volume/www/html/themes/falconchild/dev/webpack/.env
* Run npm install on _dev
* Run npm run build
* Run npm run dev  -> for hot replacement
*
* Help whith read-me file of chid theme
*
* Errors : if you get an error with Prestashop 8 and integrity check of database or ps_linklist not installing please use mak ENV=dev get-cms a second time
*
```
