{"id":16233118,"url":"https://github.com/iulyanp/symfocker","last_synced_at":"2025-10-27T22:42:13.463Z","repository":{"id":91896022,"uuid":"48295569","full_name":"iulyanp/symfocker","owner":"iulyanp","description":"A Docker setup environment for Symfony2 Framework based on Alpine","archived":false,"fork":false,"pushed_at":"2020-03-23T17:11:21.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-27T22:42:13.116Z","etag":null,"topics":["alpine","database","docker","docker-for-symfony","docker-network","docker-volumes","symfony"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iulyanp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-12-19T20:05:17.000Z","updated_at":"2021-01-26T06:23:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"d55d1a80-faaf-4fee-a51f-ee8f3a76de7d","html_url":"https://github.com/iulyanp/symfocker","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"eb4adf5ee75c7a7f865048982f2a04ac9d9ecbba"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/iulyanp/symfocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iulyanp%2Fsymfocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iulyanp%2Fsymfocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iulyanp%2Fsymfocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iulyanp%2Fsymfocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iulyanp","download_url":"https://codeload.github.com/iulyanp/symfocker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iulyanp%2Fsymfocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281355367,"owners_count":26486896,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alpine","database","docker","docker-for-symfony","docker-network","docker-volumes","symfony"],"created_at":"2024-10-10T13:11:31.672Z","updated_at":"2025-10-27T22:42:13.448Z","avatar_url":"https://github.com/iulyanp.png","language":"Dockerfile","readme":"symfocker\n==============\n\nA Docker setup environment for web development in Symfony3 Framework based on \n[Alpine Linux](https://github.com/gliderlabs/docker-alpine), \n[Docker](https://docs.docker.com/) and [docker-compose2](https://docs.docker.com/compose/install/).\n\n### Why Alpine?\n\nDocker images are usually much larger than they need to be. Alpine has only 5MB:\n\n```bash\nREPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\nalpine               latest              32653661039d        10 days ago         5.253 MB\n```\n### Requirements\n\nBefore you try this project you have to install:\n- docker engine\n- docker-compose\n- your project should be a \u003e= Symfony 3.0\n\n### Installation\n\n\n#### Step 1 - Clone this repository:\n\n```bash\n$ git clone git@github.com:iulyanpopa/symfocker.git\n```\n\n#### Step 2 - Place your Symfony 3 application into `www`\n\nNext, install your Symfony application into `www` folder and don't forget to add `127.0.0.1 app.dev` \nin your `/etc/hosts` file if you want to be able to visit `http://app.dev`.\n\n#### Step 3 - Export your user user id and group id\n\nOne of the bigger problems with docker in development is that, in docker, by default you have `root` permissions and \nlocally you change the code with your own user. This leads to a lot of problems.\nI fixed this issue very simple by mapping the local user id and group id into docker.\nAll you have to do is to export the `MY_UID` and `MY_GID` with your user id and group id.\nYou can check to see your specific user and group id on linux with `id`.\n\n```sh\n$ uid=1000(iulyanp) gid=1000(iulyanp) ...\n```\n\nYou can set default values for environment variables using a .env file, which Compose will automatically look for. \nValues set in the shell environment will override those set in the .env file.\n\n```sh\n$ echo \"MY_UID=1000\" \u003e\u003e .env\n$ echo \"MY_GID=1000\" \u003e\u003e .env\n```\n#### Step 4 - Start the containers\n\n```sh\n$ docker-compose up -d\n```\n\nThat's it, you are done. You can visit your Symfony 3 application on the following URL: [symfony.dev](http://symfony.dev)\n\nYou can also build these images yourself one by one with the `build` script\n\n```sh\n$ sh build 1\n```\n\nor like this\n\n```sh\n$ docker build -t iulyanpopa/alpine-web:latest .\n$ docker build -t iulyanpopa/alpine-php-fpm:latest .\n$ docker build -t iulyanpopa/alpine-nginx:latest .\n$ docker-compose up -d\n```\n\n### How it works?\n\nThe built images:\n\n```sh\n\u003e $ docker images\n\nREPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE\niulyanpopa/alpine-php-fpm     latest              63d85729482e        About an hour ago   99.79 MB\niulyanpopa/alpine-nginx       latest              4f647f5c8fd7        About an hour ago   6.889 MB\niulyanpopa/alpine-web         latest              4d44e9656125        About an hour ago   4.808 MB\nmysql/mysql-server            latest              6272a6121ff6        About an hour ago   316.2 MB\nalpine                        latest              baa5d63471ea        About an hour ago   4.803 MB\n```\n\nRunning containers:\n\n```sh\n\u003e $ docker-compose ps\n\n   Name                  Command               State                                                     Ports\n---------------------------------------------------------------------------------------------------------------------------------------------------------------\ndata          true                             Exit 0\nsf-elk        /usr/bin/supervisord -n -c ...   Up       0.0.0.0:81-\u003e80/tcp\nsf-mysql      /entrypoint.sh mysqld            Up       0.0.0.0:3306-\u003e3306/tcp, 33060/tcp\nsf-nginx      nginx                            Up       0.0.0.0:80-\u003e80/tcp\nsf-php-fpm    /bin/sh -c entrypoint.sh         Up\nsf-rabbitmq   docker-entrypoint.sh rabbi ...   Up       15671/tcp, 0.0.0.0:8081-\u003e15672/tcp, 25672/tcp, 4369/tcp, 0.0.0.0:5671-\u003e5671/tcp, 0.0.0.0:5672-\u003e5672/tcp\nsf-redis      docker-entrypoint.sh redis ...   Up       0.0.0.0:6379-\u003e6379/tcp      \n```\n\n* `data`: This is a data only container that contains the Symfony code,\n* `mysql`: This is the MySQL database container\n* `php-fpm`: This is the PHP-FPM container in which the application volume is mounted,\n* `nginx`: This is the Nginx webserver container in which application volume is mounted too\n\n### Logs\n\nNginx and Symfony application logs are mapped into your host machine in a named volume `symfocker_logs`\nYou can inspect the `symfocker_logs` volume.\n\n```sh\n$ docker volume inspect symfocker_logs\n[\n    {\n        \"Name\": \"symfocker_logs\",\n        \"Driver\": \"local\",\n        \"Mountpoint\": \"/var/lib/docker/volumes/symfocker_logs/_data\",\n        \"Labels\": null,\n        \"Scope\": \"local\"\n    }\n]\n```\n\nYou can check the logs like this:\n\n```\n$ sudo ls -la /var/lib/docker/volumes/symfocker_logs/_data\n```\n\nThe database is mapped into a second named volume `symfocker_database`.\n\nA third named volume is created for mapping the `php-fpm.socket` between the `php-fpm` and `nginx` containers.\n\nBehind the scenes an `symfocker_symfony` network is created and all those containers are running in this network.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiulyanp%2Fsymfocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiulyanp%2Fsymfocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiulyanp%2Fsymfocker/lists"}