{"id":15028024,"url":"https://github.com/starter-nanorocks/symfony-php-starter-kit","last_synced_at":"2025-10-29T13:20:05.681Z","repository":{"id":244462432,"uuid":"815311773","full_name":"starter-nanorocks/symfony-php-starter-kit","owner":"starter-nanorocks","description":"Symfony starter kit setup with docker, docker-compose, php8.2 nginx, adminer, postgresql, mailhog, SymfonyPHP 7.1, pre-commit setup with psr-12 and phpstan","archived":false,"fork":false,"pushed_at":"2024-06-14T21:36:56.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-19T21:47:41.793Z","etag":null,"topics":["adminer","docker","docker-compose","nginx","php82","phpstan","postgresql","psr-12","symfony7","xdebug"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nanorocks/elrnero","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/starter-nanorocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-14T20:38:49.000Z","updated_at":"2024-06-15T12:15:40.000Z","dependencies_parsed_at":"2024-09-27T14:24:00.352Z","dependency_job_id":null,"html_url":"https://github.com/starter-nanorocks/symfony-php-starter-kit","commit_stats":null,"previous_names":["starter-nanorocks/symfony-php-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starter-nanorocks%2Fsymfony-php-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starter-nanorocks%2Fsymfony-php-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starter-nanorocks%2Fsymfony-php-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starter-nanorocks%2Fsymfony-php-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starter-nanorocks","download_url":"https://codeload.github.com/starter-nanorocks/symfony-php-starter-kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338139,"owners_count":20275432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adminer","docker","docker-compose","nginx","php82","phpstan","postgresql","psr-12","symfony7","xdebug"],"created_at":"2024-09-24T20:07:29.651Z","updated_at":"2025-10-29T13:20:00.604Z","avatar_url":"https://github.com/starter-nanorocks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony PHP Starter Kit\n\nThis is a starter kit for Symfony 7.1 with the following technologies:\n\n- Docker\n- Docker Compose\n- PHP 8.2\n- Nginx\n- Adminer\n- PostgreSQL\n- MailHog\n- Xdebug\n\n## Requirements\n\n- Docker\n- Docker Compose\n\n## Getting Started\n\n1. Clone the repository:\n\n   ```sh\n   git clone https://github.com/yourusername/symfony-starter-kit.git\n   cd symfony-starter-kit\n   ```\n\n2. Create environment variables:\n\n   ```sh\n   cp .env.dist .env\n   ```\n\n3. Build and start the containers:\n\n   ```sh\n   docker-compose up --build -d\n   ```\n\n4. Install Symfony dependencies:\n\n   ```sh\n   docker-compose exec php composer install\n   ```\n\n## Services\n\n- **PHP 8.2**: The PHP version used for the application.\n- **Nginx**: Serves the Symfony application.\n- **PostgreSQL**: The database server.\n- **Adminer**: Database management tool accessible at [http://localhost:8080](http://localhost:8080).\n- **MailHog**: Email testing tool accessible at [http://localhost:8025](http://localhost:8025).\n\n## Docker Compose Configuration\n\nHere is the `docker-compose.yml` configuration:\n\n```yaml\nversion: '4.2'\n\nservices:\n  php-fpm:\n    container_name: php\n    build:\n      context: .\n      dockerfile: docker/php/Dockerfile\n    volumes:\n      - ./symfony:/var/www/html/symfony\n      - ./docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini\n      - ./docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini\n    networks:\n      - starter-kit\n\n  nginx:\n    container_name: nginx\n    image: nginx:stable\n    ports:\n      - '80:80'\n    volumes:\n      - ./symfony:/var/www/html/symfony\n      - ./docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf\n    networks:\n      - starter-kit\n\n  db:\n    container_name: postgres\n    image: postgres\n    restart: always\n    shm_size: 128mb\n    environment:\n      POSTGRES_PASSWORD: secret\n    ports:\n      - '5432:5432'\n    volumes:\n      - ./docker/db/init.sql:/docker-entrypoint-initdb.d/init.sql\n    networks:\n      - starter-kit\n    command: postgres -c 'max_connections=200'\n\n  adminer:\n    container_name: adminer\n    image: adminer\n    restart: always\n    environment:\n      ADMINER_DEFAULT_DB_HOST: database\n      ADMINER_DESIGN: haeckel\n      ADMINER_PLUGINS: tables-filter tinymce\n    ports:\n      - '54320:8080'\n    networks:\n      - starter-kit\n\n  mailhog:\n    container_name: mailhog\n    image: mailhog/mailhog:latest\n    restart: always\n    ports:\n      - 1025:1025\n      - 8025:8025\n    networks:\n      - starter-kit\n\nnetworks:\n  starter-kit:\n    driver: bridge\n```\n\n## Pre-commit Setup with GrumPHP\n\n### Install GrumPHP\n\nAdd GrumPHP to your Symfony project using Composer:\n\n```sh\ndocker-compose exec php composer require --dev phpro/grumphp\n```\n\n### Configure GrumPHP\n\nCreate a `grumphp.yml` file in the root of your project:\n\n```yaml\ngrumphp:\n    tasks:\n        phpcs:\n            standard:\n                - 'PSR12'\n        phpstan:\n            autoload_file: ~\n            configuration: ~\n            level: null\n            force_patterns: []\n            ignore_patterns: []\n            triggered_by: ['php']\n            memory_limit: \"-1\"\n            use_grumphp_paths: true\n```\n\n### Update composer.json\n\nAdd the GrumPHP configuration to your `composer.json` scripts section to automatically run GrumPHP on `git commit`:\n\n```json\n\"scripts\": {\n    \"post-install-cmd\": [\n        \"vendor/bin/grumphp git:init\"\n    ],\n    \"post-update-cmd\": [\n        \"vendor/bin/grumphp git:init\"\n    ]\n}\n```\n\n### Initialize GrumPHP\n\nRun the following command to initialize GrumPHP:\n\n```sh\nphp vendor/bin/grumphp git:init\n```\n\n## Database Configuration\n\nUpdate the `.env` file with your database credentials:\n\n```\nDATABASE_URL=postgresql://symfony:symfony@postgres:5432/symfony\n```\n\n## Accessing Services\n\n- Symfony application: [http://localhost:8000](http://localhost:8000)\n- Adminer: [http://localhost:8080](http://localhost:8080)\n- MailHog: [http://localhost:8025](http://localhost:8025)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarter-nanorocks%2Fsymfony-php-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarter-nanorocks%2Fsymfony-php-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarter-nanorocks%2Fsymfony-php-starter-kit/lists"}