Skip to content

Commit

Permalink
Merge pull request #1 from dvlpm/feature/INFR-1
Browse files Browse the repository at this point in the history
INFR-1: composer.json added
  • Loading branch information
ehunov authored May 10, 2020
2 parents b017010 + ae45346 commit c2c0049
Show file tree
Hide file tree
Showing 11 changed files with 258 additions and 22 deletions.
17 changes: 17 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
###> dvlpm/docker ###
NGINX_PORT=80
POSTGRES_PORT=5432
POSTGRES_TEST_PORT=5433
DEBUG_REMOTE_HOST=192.168.99.1
DEBUG_SERVER_NAME=0.0.0.0
###> dvlpm/docker ###

###> dvlpm/database ###
DATABASE_NAME=poster
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres
###< dvlpm/database ###

###> doctrine/doctrine-bundle ###
DATABASE_URL=pgsql://${DATABASE_USER}:${DATABASE_PASSWORD}@postgres:5432/${DATABASE_NAME}
###< doctrine/doctrine-bundle ###
17 changes: 17 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
###> dvlpm/docker ###
NGINX_PORT=80
POSTGRES_PORT=5432
POSTGRES_TEST_PORT=5433
DEBUG_REMOTE_HOST=192.168.99.1
DEBUG_SERVER_NAME=0.0.0.0
###> dvlpm/docker ###

###> dvlpm/database ###
DATABASE_NAME=poster
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres
###< dvlpm/database ###

###> doctrine/doctrine-bundle ###
DATABASE_URL=pgsql://${DATABASE_USER}:${DATABASE_PASSWORD}@postgres:5432/${DATABASE_NAME}
###< doctrine/doctrine-bundle ###
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
.idea
docker-compose.yml
.env
docker-compose.override.yml
docker-compose.test.override.yml

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
ENV?=dev

dca := docker-compose \
-f docker-compose.yml \
-f docker-compose.override.yml

dct := $(dca) \
-f docker-compose.test.yml \
-f docker-compose.test.override.yml

de-php := docker-compose exec php sh -c

### ---------------------
### Init
### ---------------------
init: up composer-install migrate

###
composer:
$(de-php) '$(MAKECMDGOALS)'

migrate:
$(de-php) 'bin/console doctrine:migrations:migrate'

### ---------------------
### Develop
### ---------------------
up:
$(dca) up -d

ups:
$(dca) up

down:
$(dca) down

sh:
$(de-php) 'bash'

### ---------------------
### Test
### ---------------------
test-up:
$(dct) up -d

test-ups:
$(dct) up

test-down:
$(dct) down

test-migrate:
$(de-php) 'bin/console doctrine:migrations:migrate --env=test'

### ---------------------
### Builds
### ---------------------

### ---------------------
### Help
### ---------------------
# ignore all not-found targets
%:
@:
81 changes: 81 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "dvlpm/skeleton",
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-json": "*",
"league/tactician": "^1.0",
"ramsey/uuid": "^3.8",
"sensio/framework-extra-bundle": "^5.4",
"symfony/console": "5.*",
"symfony/dotenv": "5.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "5.*",
"symfony/orm-pack": "^1.0",
"symfony/serializer-pack": "^1.0",
"symfony/validator": "5.*",
"symfony/yaml": "5.*"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-asserts": "^1.2",
"codeception/module-doctrine2": "^1.0",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-rest": "^1.2",
"codeception/module-symfony": "^1.1",
"doctrine/doctrine-fixtures-bundle": "^3.2",
"jdorn/sql-formatter": "^1.2",
"lamoda/codeception-wiremock-extension": "^1.4",
"phpunit/phpunit": "^8.3",
"symfony/browser-kit": "5.*",
"symfony/maker-bundle": "^1.13"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": ["tests/"]
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.0.*"
}
}
}
18 changes: 0 additions & 18 deletions docker-compose.example.yml

This file was deleted.

1 change: 1 addition & 0 deletions docker-compose.override.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: '3'
1 change: 1 addition & 0 deletions docker-compose.test.override.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: '3'
27 changes: 27 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'
services:
postgres-test:
image: postgres:12-alpine
ports:
- ${POSTGRES_TEST_PORT}:5432
volumes:
- pgdata-test:/var/lib/postgresql/data/pgdata
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
php:
environment:
APP_ENV: test

wiremock:
image: rodolpheche/wiremock:latest
ports:
- 8888:8080
environment:
- TZ=Europe/Moscow
command: "--global-response-templating"

volumes:
pgdata-test:
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3'
services:
nginx:
image: nginx:alpine
ports:
- ${NGINX_PORT}:80
volumes:
- ./volumes/nginx/default.conf:/etc/nginx/conf.d/default.conf:cached
- ./:/var/www/html:cached
- composer:/var/www/.composer
php:
image: dvlpm/php7.4-dev:latest
volumes:
- ./:/var/www/html
- ./volumes/php/conf.d/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
environment:
XDEBUG_CONFIG: remote_host=${DEBUG_REMOTE_HOST}
PHP_IDE_CONFIG: serverName=${DEBUG_SERVER_NAME}

postgres:
image: postgres:12-alpine
ports:
- ${POSTGRES_PORT}:5432
volumes:
- pgdata:/var/lib/postgresql/data/pgdata
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
volumes:
pgdata:
composer:

0 comments on commit c2c0049

Please sign in to comment.