Skip to content

Commit

Permalink
chubbyphp-mongo-rockylinux
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Sep 12, 2022
1 parent 3a2d481 commit 44fcea2
Show file tree
Hide file tree
Showing 35 changed files with 312 additions and 426 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CI

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

Expand All @@ -28,10 +27,10 @@ jobs:
runs-on: ubuntu-20.04
services:
mongo:
image: mongo:4.4-bionic
image: mongo:5.0
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_ROOT_USERNAME: petstore
MONGO_INITDB_ROOT_PASSWORD: KVKtkrTHhKuTJTor8pCP
ports:
- 27017:27017
steps:
Expand All @@ -44,18 +43,18 @@ jobs:
uses: docker://chubbyphp/ci-php80:latest
env:
APP_ENV: phpunit
DATABASE_URI: mongodb://root:root@172.17.0.1:27017
DATABASE_URI: mongodb://petstore:KVKtkrTHhKuTJTor8pCP@172.17.0.1:27017
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php81:
name: PHP 8.1
runs-on: ubuntu-20.04
services:
mongo:
image: mongo:4.4-bionic
image: mongo:5.0
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_ROOT_USERNAME: petstore
MONGO_INITDB_ROOT_PASSWORD: KVKtkrTHhKuTJTor8pCP
ports:
- 27017:27017
steps:
Expand All @@ -68,7 +67,7 @@ jobs:
uses: docker://chubbyphp/ci-php81:latest
env:
APP_ENV: phpunit
DATABASE_URI: mongodb://root:root@172.17.0.1:27017
DATABASE_URI: mongodb://petstore:KVKtkrTHhKuTJTor8pCP@172.17.0.1:27017
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- name: sonarcloud.io
Expand Down
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.DS_Store
.idea/
.vscode/
build/
build
composer.lock
var/
vendor/
database
var
vendor
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ A simple skeleton to build api's based on the [chubbyphp-framework][1].
* [chubbyphp/chubbyphp-framework][6]: ^4.1
* [chubbyphp/chubbyphp-framework-router-fastroute][7]: ^1.3.1
* [chubbyphp/chubbyphp-laminas-config][8]: ^1.3
* [chubbyphp/chubbyphp-laminas-config-doctrine][9]: ^1.3
* [chubbyphp/chubbyphp-laminas-config-doctrine][9]: ^2.0
* [chubbyphp/chubbyphp-laminas-config-factory][10]: ^1.2
* [chubbyphp/chubbyphp-negotiation][11]: ^1.9
* [chubbyphp/chubbyphp-serialization][12]: ^3.2
* [chubbyphp/chubbyphp-validation][13]: ^3.12.3
* [doctrine/mongodb-odm][14]: ^2.3.1
* [doctrine/mongodb-odm][14]: ^2.4.2
* [monolog/monolog][15]: ^2.3.5
* [ramsey/uuid][16]: ^4.2.3
* [slim/psr7][17]: ^1.5
* [swagger-api/swagger-ui][18]: ^4.6.1
* [symfony/console][19]: ^6.0.5
* [symfony/console][19]: ^5.4.11|^6.1.3

## Environment

Expand All @@ -47,13 +47,12 @@ docker-compose exec php bash
```

### Urls

* http://localhost:10080
* https://localhost:10443
^
* https://localhost

### DBs

* jdbc:mongodb://root:root@localhost:12717/petstore
* jdbc:mongodb://petstore:4aAUfBjDACcdZxNwJgJ6@localhost:27017/petstore

## Installation

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"chubbyphp/chubbyphp-framework": "^4.1",
"chubbyphp/chubbyphp-framework-router-fastroute": "^1.3.1",
"chubbyphp/chubbyphp-laminas-config": "^1.3",
"chubbyphp/chubbyphp-laminas-config-doctrine": "^1.3",
"chubbyphp/chubbyphp-laminas-config-doctrine": "^2.0",
"chubbyphp/chubbyphp-laminas-config-factory": "^1.2",
"chubbyphp/chubbyphp-negotiation": "^1.9",
"chubbyphp/chubbyphp-serialization": "^3.2",
"chubbyphp/chubbyphp-validation": "^3.12.3",
"doctrine/mongodb-odm": "^2.3.1",
"doctrine/mongodb-odm": "^2.4.2",
"monolog/monolog": "^2.3.5",
"ramsey/uuid": "^4.2.3",
"slim/psr7": "^1.5",
"swagger-api/swagger-ui": "^4.6.1",
"symfony/console": "^6.0.5"
"symfony/console": "^5.4.11|^6.1.3"
},
"require-dev": {
"chubbyphp/chubbyphp-dev-helper": "dev-master",
Expand Down
9 changes: 4 additions & 5 deletions config/prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
use Chubbyphp\Framework\Router\RouteMatcherInterface;
use Chubbyphp\Framework\Router\RoutesInterface;
use Chubbyphp\Framework\Router\UrlGeneratorInterface;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\Common\Cache\ApcuCacheFactory;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\Common\Cache\ApcuAdapterFactory;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ODM\MongoDB\DocumentManagerFactory;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\Persistence\Mapping\Driver\ClassMapDriverFactory;
use Chubbyphp\Negotiation\AcceptNegotiatorInterface;
Expand All @@ -80,7 +80,6 @@
use Chubbyphp\Validation\ServiceFactory\ValidationMappingProviderRegistryFactory;
use Chubbyphp\Validation\ServiceFactory\ValidatorFactory;
use Chubbyphp\Validation\ValidatorInterface;
use Doctrine\Common\Cache\Cache;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Monolog\Logger;
Expand All @@ -89,6 +88,7 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Psr\Cache\CacheItemPoolInterface;

$rootDir = \realpath(__DIR__.'/..');
$cacheDir = $rootDir.'/var/cache/'.$env;
Expand All @@ -112,7 +112,7 @@
AcceptNegotiatorInterface::class => AcceptNegotiatorFactory::class,
AcceptNegotiatorInterface::class.'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class,
ApiExceptionMiddleware::class => ApiExceptionMiddlewareFactory::class,
Cache::class => ApcuCacheFactory::class,
CacheItemPoolInterface::class => ApcuAdapterFactory::class,
Command::class.'[]' => CommandsFactory::class,
ContentTypeNegotiatorInterface::class => ContentTypeNegotiatorFactory::class,
ContentTypeNegotiatorInterface::class.'supportedMediaTypes[]' => ContentTypeNegotiatorSupportedMediaTypesFactory::class,
Expand Down Expand Up @@ -162,7 +162,6 @@
'namespace' => 'doctrine',
],
],

'driver' => [
'classMap' => [
'map' => [
Expand All @@ -189,7 +188,7 @@
'proxyNamespace' => 'DoctrineMongoDBODMProxy',
'hydratorDir' => $cacheDir.'/doctrine/mongodbOdm/hydrators',
'hydratorNamespace' => 'DoctrineMongoDBODMHydrators',
'metadataCacheImpl' => Cache::class,
'metadataCache' => CacheItemPoolInterface::class,
'defaultDB' => 'petstore',
],
],
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ services:
container_name: petstore-php
hostname: petstore-php
build:
dockerfile: ./docker/prod/php/Dockerfile
dockerfile: ./docker/production/php/Dockerfile
context: ./
environment:
APP_ENV: phpunit
DATABASE_URI: mongodb://root:root@mongo:27017
DATABASE_URI: mongodb://petstore:KVKtkrTHhKuTJTor8pCP@mongo:27017
depends_on:
- mongo
mongo:
container_name: petstore-mongo
hostname: petstore-mongo
image: mongo:4.4
image: mongo:5.0
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_ROOT_USERNAME: petstore
MONGO_INITDB_ROOT_PASSWORD: KVKtkrTHhKuTJTor8pCP
nginx:
container_name: petstore-nginx
hostname: petstore-nginx
build:
dockerfile: ./docker/prod/nginx/Dockerfile
dockerfile: ./docker/production/nginx/Dockerfile
context: ./
environment:
APP_ENV: phpunit
Expand Down
80 changes: 18 additions & 62 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ services:
container_name: petstore-php
hostname: petstore-php
build:
dockerfile: ./docker/dev/php/Dockerfile
dockerfile: ./docker/development/php/Dockerfile
context: ./
args:
USER_ID: ${USER_ID:-1000}
GROUP_ID: ${GROUP_ID:-1000}
environment:
APP_ENV: dev
DATABASE_URI: mongodb://root:root@mongo:27017
DATABASE_URI: mongodb://petstore:4aAUfBjDACcdZxNwJgJ6@mongo:27017
SSH_AUTH_SOCK: /ssh-agent
BLACKFIRE_CLIENT_ID: ${BLACKFIRE_CLIENT_ID}
BLACKFIRE_CLIENT_TOKEN: ${BLACKFIRE_CLIENT_TOKEN}
volumes:
- ${PWD}:/var/www/html
- ~/.bash_aliases:/var/www/.bash_aliases
- ~/.bash_history:/var/www/.bash_history
- ~/.gitconfig:/var/www/.gitconfig
- ~/.gitignore:/var/www/.gitignore
- ~/.zsh_aliases:/var/www/.zsh_aliases
- ~/.zsh_history:/var/www/.zsh_history
- ${PWD}:/app
- ~/.bash_docker:/home/php/.bash_docker
- ~/.bash_history:/home/php/.bash_history
- ~/.gitconfig:/home/php/.gitconfig
- ~/.gitignore:/home/php/.gitignore
- ~/.zsh_docker:/home/php/.zsh_docker
- ~/.zsh_history:/home/php/.zsh_history
- $SSH_AUTH_SOCK:/ssh-agent
depends_on:
- mongo
Expand All @@ -31,65 +29,23 @@ services:
mongo:
container_name: petstore-mongo
hostname: petstore-mongo
image: mongo:4.4
image: mongo:5.0
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_ROOT_USERNAME: petstore
MONGO_INITDB_ROOT_PASSWORD: 4aAUfBjDACcdZxNwJgJ6
ports:
- '12717:27017'
- '27017:27017'
volumes:
- ./database/mongo:/data/db
nginx:
container_name: petstore-nginx
hostname: petstore-nginx
build:
dockerfile: ./docker/dev/nginx/Dockerfile
dockerfile: ./docker/development/nginx/Dockerfile
context: ./
environment:
APP_ENV: dev
ports:
- '10080:80'
- '10443:443'
- '443:443'
volumes:
- ${PWD}:/var/www/html:ro
- ${PWD}:/app:ro
depends_on:
- php
blackfire:
container_name: petstore-blackfire
hostname: petstore-blackfire
image: blackfire/blackfire
environment:
BLACKFIRE_SERVER_ID: ${BLACKFIRE_SERVER_ID}
BLACKFIRE_SERVER_TOKEN: ${BLACKFIRE_SERVER_TOKEN}
elasticsearch:
container_name: petstore-elasticsearch
hostname: petstore-elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
environment:
discovery.type: single-node
ES_JAVA_OPTS: '-Xms256m -Xmx256m'
ulimits:
memlock:
soft: -1
hard: -1
ports:
- '19200:9200'
filebeat:
container_name: petstore-filebeat
hostname: petstore-filebeat
image: docker.elastic.co/beats/filebeat:7.10.1
command: --strict.perms=false
user: root
volumes:
- ./docker/prod/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- ./var/log:/var/log/application:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- elasticsearch
kibana:
container_name: petstore-kibana
hostname: petstore-kibana
image: docker.elastic.co/kibana/kibana:7.10.1
ports:
- '15601:5601'
depends_on:
- elasticsearch
3 changes: 0 additions & 3 deletions docker/dev/nginx/Dockerfile

This file was deleted.

0 comments on commit 44fcea2

Please sign in to comment.