Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alaugks/docker-local-env

Services for locale development Environment
https://github.com/alaugks/docker-local-env

codesniffer docker docker-compose local-development mariadb minio mongodb redis s3mock

Last synced: about 1 month ago
JSON representation

Services for locale development Environment

Awesome Lists containing this project

README

        

# Services for locale Development



Service
Container Name
Ports
Network
Credentials




MariaDB 10.9.3
mariadb-10-9
13306:3306
dev_network

RootUsername: root

RootPassword: root-password

DefaultDatabase: dev-database

DefaultUser: dev-user

DefaultPassword: dev-password




MariaDB 10.6.16
mariadb-10-6
13307:3306
dev_network

RootUsername: root

RootPassword: root-password

DefaultDatabase: dev-database

DefaultUser: dev-user

DefaultPassword: dev-password




Redis 7.2.4
redis-7-2
16379:6379
dev_network



MongoDB 7.0.12
mongo-7-0
27017:27017
dev_network

RootUsername: root

RootPassword: root-dev-password




PHP-FPM 8.2.21 for CodeSniffer


dev_network



S3Mock 3.11.0
s3mock-3
9092:9090
dev_network



min.io RELEASE.2024-06-29T01-20-47Z
minio

9004:9000

9005:9001 (MinIO Console)

dev_network

RootUsername: minio

RootPassword: dev-password



## Installation

### Clone project

```bash
git clone [email protected]:alaugks/docker-local-env.git
```

### Change directory

```bash
cd docker-local-env
```

### Run docker compose

```bash
docker compose up -d
```

## Example of usage (MariaDB 10.9.*)

### Example Symfony

**.env.local**

```dotenv
DB_DRIVER=mysql
DB_USER=dev-user
DB_PASSWORD=dev-password
DB_HOST=mariadb-10-9
DB_PORT=3306
DB_NAME=your_database
DB_SERVER_VERSION=10.9.3-MariaDB
```

**services.yaml**

```yaml
parameters:
database_url: '%env(DB_DRIVER)%://%env(DB_USER)%:%env(DB_PASSWORD)%@%env(DB_HOST)%:%env(DB_PORT)%/%env(DB_NAME)%?serverVersion=%env(DB_SERVER_VERSION)%'
```

### Example Spring Boot

**application.properties**

```dotenv
spring.datasource.url=jdbc:mariadb://mariadb-10-9:3306/your_database
spring.datasource.username=dev-user
spring.datasource.password=dev-password
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
```

## Use CodeSniffer in PHPStorm

**Settings CLI Interpreters**

![CLI_Interpreters.png](docs/CLI_Interpreters.png)

**Settings PHP CodeSniffer**

![PHP_CodeSniffer.png](docs/PHP_CodeSniffer.png)

**Path Code Sniffer**

```
/var/www/html/vendor/squizlabs/php_codesniffer/bin/phpcs
```

**Path Code Beautifier**

```
/var/www/html/vendor/squizlabs/php_codesniffer/bin/phpcbf
```