{"id":21053512,"url":"https://github.com/etcinit/vertex","last_synced_at":"2025-05-15T21:36:49.209Z","repository":{"id":18178223,"uuid":"21291738","full_name":"etcinit/vertex","owner":"etcinit","description":"A barebones Docker image with essentials for PHP developement and deployment","archived":false,"fork":false,"pushed_at":"2016-08-24T22:25:26.000Z","size":513,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-08-04T10:11:08.858Z","etag":null,"topics":["docker","hhvm","shell"],"latest_commit_sha":null,"homepage":"https://quay.io/etcinit/vertex/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etcinit.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}},"created_at":"2014-06-27T23:06:57.000Z","updated_at":"2023-08-04T10:11:08.859Z","dependencies_parsed_at":"2022-09-24T22:34:01.744Z","dependency_job_id":null,"html_url":"https://github.com/etcinit/vertex","commit_stats":null,"previous_names":[],"tags_count":10,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etcinit%2Fvertex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etcinit%2Fvertex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etcinit%2Fvertex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etcinit%2Fvertex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etcinit","download_url":"https://codeload.github.com/etcinit/vertex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225384399,"owners_count":17465879,"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":["docker","hhvm","shell"],"created_at":"2024-11-19T16:07:01.607Z","updated_at":"2024-11-19T16:07:02.250Z","avatar_url":"https://github.com/etcinit.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://i.imgur.com/Ai4VtYt.png)\n\n# Vertex\n\nA barebones Docker image with essentials for PHP/Hack development and \ndeployment.\n\n## Batteries included:\n\n- Web servers: Proxygen, Nginx (Optional)\n- Runtimes: HHVM 3.12.1, Node.js 5.9, Python 2.7.\n- Package managers: `composer`, `npm`.\n- Development: `git`, `curl`.\n\n## Recent changes:\n\n**What's new in v4.0?:**\n\n- Upgraded to Debian Jessie (`google/debian` -\u003e `debian`).\n- Updated packages: HHVM 3.12.1, Node.js 5.9.\n- New developer tools: `vmenu`, `vinstall`.\n- Nginx is available again, but it is not installed by default.\n- New build scripts.\n\n**What's new in v3.2?:**\n\n- Nginx is dropped in favor of HHVM's built-in web server (Proxygen).\n- HHVM 3.11.0 (with PHP 7 support).\n- Node.js 5.0.\n\n**What's new in v3?:**\n\n- Uses `google/debian` instead of `ubuntu`.\n- Newer version of included packages.\n- Image size optimizations.\n\n## Requirements\n\n- Docker 1.7+\n- Docker Compose (Optional)\n\n## Getting started\n\nGetting a shell inside a Vertex container is easy, even if it is your first \ntime using Docker:\n\n### Using Quay.io:\n\nPull down a pre-built image from the Quay.io, and run a shell inside the \ncontainer afterwards:\n\n```sh\ndocker run -ti quay.io/etcinit/vertex:3.0.0 begin\n```\n\n### From the source code:\n\nFirst, you need to clone this git repository:\n\n```sh\ngit clone git@github.com:etcinit/vertex.git\ncd vertex\n```\n\n#### Option 1: Using Make\n\nIf you have `make` installed, we have simplified the process for you:\n\n```sh\nmake login\n```\nThe provided Makefile essentially just calls Docker Compose for you and gets a\nshell up and going.\n\nAlternatively, you may also just build the image:\n\n```sh\nmake\n```\n\n\u003e **NOTE:** These commands will only allow you to build and login to the \ncontainer. They will not automatically bind ports for your servers. See the \nsections below for instructions on how to get servers running and binding \nports.\n\n#### Option 2: Using Docker Compose\n\nWith Docker Compose, it is also pretty easy to get a container running:\n\n```sh\n# First, build the image:\ndocker-compose build\n\n# Then, login:\ndocker-compose run web begin\n```\n\n\u003e **NOTE:** These commands will only allow you to build and login to the \ncontainer. They will not automatically bind ports for your servers. See the \nsections below for instructions on how to get servers running and binding \nports.\n\n#### Option 3: Using the Docker CLI\n\nIf you would like to understand how the internal works, we recommend \nbuilding the image by hand by interacting with the Docker CLI directly:\n\n```sh\ndocker build -t vertex .\n\n# This may take some time if it is the first Vertex image you \n# have built on your system\n\n# Start hacking:\ndocker run -it vertex begin\n\n# Allow a server to run on port 80:\ndocker run -it -p 80:80 vertex begin\n```\n\n\u003e **NOTE:** Unlike options 1 and 2, the last command will actually bind a port\nfor your HTTP server for you. See the sections below for instructions on how \nto get servers running and binding ports.\n\n### Getting your files inside the container:\n\nDepending on which of the options above you chose to get Vertex running on \nyour machine, you might have already some directories mounted inside the \ncontainer.\n\n#### Mounting\n\nDocker has allows you to mount external directories or even share them between\ncontainers through a concept called Volumes. If you used the Makefile or Docker\nCompose, the current working directory was automatically mounted into \n`/var/www/vertex`.\n\nIf you are using the Docker CLI, you can replicate this by using the `-v` \nparameter:\n\n```sh\ndocker run -ti vertex -v $(pwd):/var/www/vertex\n\n# Custom mapping are also possible:\ndocker run -ti vertex -v $(pwd):/opt/mynodeapp\ndocker run -ti vertex -v /home/user1/app:/opt/myapp\n```\n\n#### Using a Dockerfile and `ADD` or `COPY`:\n\nIf you are using Vertex as the base image of your project, you may add files \nto the image by using the `ADD` and `COPY` commands:\n\n```Dockerfile\nFROM quay.io/etcinit/vertex:3.0.0\n# ...\n\n# It is possible to override the default PHP project:\nADD . /var/www/vertex\n\n# Add arbitrary files:\nADD app.js /app.js\n\n# Or even replace existing configuration files:\nADD site.ini /vertex/hhvm/site.ini\n```\n\n## PHP and Hack Development\n\n### The sample project:\n\nVertex is pre-configured with a default PHP project inside `/var/www/vertex`. \nYou can add any framework to this directory, such as Laravel, Wordpress, \nSymfony, or even your own. Public files are assumed to be in \n`/var/www/vertex/public`, which is where the web server will server files \nfrom.\n\nThis default setup is useful if you're looking to get a server running a PHP \nproject with the least amount of configuration possible. However, if you need \nto change the default HHVM settings, you will need to add your own \nconfigurations files inside the container.\n\nNote: Make sure that when adding files, they are still executable by HHVM \nwhich uses the `www-data` user.\n\n\u003e **IMPORTANT:** For more information on getting files on the container, read \nthe section above. Using the Makefile or Docker Compose from the wrong \ndirectory could break the default project.\n\nOnce the server is running you should see the following page:\n\n![Screenshot](http://i.imgur.com/ucJXOmm.png)\n\n### From Quay.io:\n\nMount the current directory into `/var/www/vertex` and start HHVM:\n\n```sh\ndocker run -it -v \"$(pwd):/var/www/vertex\" -p 80:80 quay.io/etcinit/vertex\n```\n\n**Note:** This makes the assumption that your project has a `public` directory. \nOtherwise, modify the `-v` option to point to a directory with an `index.php` \nor `index.html` file.\n\n### From the Vertex GitHub repository:\n\nIf you pulled `etcinit/vertex` from GitHub, you can run a server using the \nMakefile or manually:\n\nStart HHVM at port 80:\n\n```sh\nmake server\n\n# -- OR --\n\ndocker run -ti -p 80:80 -v $(pwd):/var/www/vertex vertex\n```\n\n## Dockerfiles and pre-built images\n\nThe purpose of Vertex is to have a pre-built image with some of the basic \ndependencies for a PHP project. The benefit? Saved time. This image\nis built automatically on Quay.io. If one of your projects uses it as a\nbase image, you don't need to waste time downloading common dependencies.\n\n\u003e **NOTE**: While Vertex saves some time, it is no replacement for a single \npurpose image. If you need a small image, please build your own or use one \nfrom a Docker registry.\n\n### Dockerfile workflow\n\n__To use it as part of a project:__\n\nYour project needs to have Dockerfile on the root directory of the project. \nReview the Docker documentation for more information about the syntax and \npurpose of this file.\n\nAdding the following line to the top of your docker file specifies the base \nimage:\n```\nFROM quay.io/etcinit/vertex:3.0.0\n```\n\n\u003e **NOTE:** Remove `FROM ubuntu` if you were using ubuntu as the base image. \nYou can only have one base image. Vertex is based on Debian.\n\n#### Example usage:\n\nThe following is an example of how to use Vertex in a PHP project:\n\n```Dockerfile\nFROM quay.io/etcinit/vertex:3.0.0\n\n# Add the current directory into the image. This replaces the sample project.\nADD . /var/www/vertex\n\n# Set the current working directory\nWORKDIR /var/www/vertex\n\n# Run composer update\nRUN composer update\n\n# Expose ports\nEXPOSE 80\n\n# Logs volume\nVOLUME [\"/var/www/vertex/storage/logs\"]\n\n# Start servers\nCMD [\"/opt/start.sh\"]\n```\n\nIf you don't mount your project using the `-v` tag while using `docker run`, \nyour code won't automatically update inside the container; it will only update\nduring a `docker build`.\n\nOnce you have a Dockerfile, you can build your application image (Here we will \ntag it as `php-app` for reference):\n\n```bash\ndocker build -t php-app .\n```\n\n**Note:** Don't forget about the dot at the end\n\nAfter your image is built, you can run it:\n\n```bash\ndocker run -ti -p 80:80 php-app\n\n# Additionally, you can mount a directory so that your code updates \n# automatically as you work:\ndocker run -ti -v \"$(pwd):/var/www/vertex\" -p 80:80 php-app\n```\n\n## What about Node.js?\n\n\u003e **WARNING:** Node.js is no longer a supported deployment platform on Vertex.\nIt's mainly there for build-time asset compilation (SCSS and JS).\n\nNode.js projects can be setup without using `/opt/start.sh` since most Node.js \nproject only require you to launch the server:\n\n```bash\ndocker run -ti quay.io/etcinit/vertex -v \"$(pwd):/app\" \\\n    -p 3000:3000 node /app/index.js\n```\n### Example dockerfile:\n\nAssuming that your application runs on port 3000:\n\n```Dockerfile\nFROM quay.io/etcinit/vertex:3.0.0\n\n# Add the current directory into the image\nADD . /app\n\n# Set the current working directory\nWORKDIR /app\n\n# Run install dependencies\nRUN npm install\n\n# Expose ports\nEXPOSE 3000\n\n# Logs volume\nVOLUME [\"/app/logs\"]\n\n# Start servers\nCMD [\"node /app/index\"]\n```\n\n## Resources\n\nSome additional reading and resources:\n\n- [Docker Online Tutorial](https://www.docker.com/tryit/)\n- [Managing data in containers](https://docs.docker.com/userguide/dockervolumes/)\n- [Linking containers](https://docs.docker.com/userguide/dockerlinks/)\n- [Port forwarding](https://github.com/wsargent/docker-cheat-sheet#exposing-ports)\n\n### Got questions? Found a bug?\n\nOpen a ticket here on GitHub, or if you have a fix or improvement, create a \nPull Request. Given that this is a Docker-only project there aren't any strict\ncontribution rules around code. Just keep every line under 80 characters, add\nsome descriptive comments, and it should be fine.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetcinit%2Fvertex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetcinit%2Fvertex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetcinit%2Fvertex/lists"}