Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-compose setup #263

Merged
merged 13 commits into from
Mar 27, 2019
Merged

Add docker-compose setup #263

merged 13 commits into from
Mar 27, 2019

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Mar 19, 2019

This is my attempt on #231.

Uses docker layered builds to optimize caching, the resulting image will be smallest, but layers caching is efficinent.

besides that, uses official docker PHP alpine image: php:7.3-fpm-alpine and same for mongo image. I've used percona variant but can switch to MongoDB if needed.

The customizations, for now, just edit your local docker-compose.yml or create docker-compose.override.yml with overrides. But could be extended with .env overrides in separate PR if there's interest.

@glensc glensc mentioned this pull request Mar 19, 2019
Dockerfile Outdated Show resolved Hide resolved
@lauripiisang
Copy link
Contributor

Please add docker usage information to README as well.

README.md Outdated Show resolved Hide resolved
@glensc
Copy link
Contributor Author

glensc commented Mar 21, 2019

added readme section.

I omitted the configuration readme block, as I intended to make it automatic:

But this needs to be tested first, I will not push to this branch until tested, so this could be still merged.

@glensc
Copy link
Contributor Author

glensc commented Mar 21, 2019

ok, tested the mongodb indexes init. so adding commits to this branch.

➔ docker-compose exec mongo mongo xhprof --eval 'db.results.getIndexes()'
Percona Server for MongoDB shell version v3.6.11-3.1
connecting to: mongodb://127.0.0.1:27017/xhprof?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("c8da7aa9-35ce-4141-a5da-2aa6c3c55c62") }
Percona Server for MongoDB server version: v3.6.11-3.1
[
	{
		"v" : 2,
		"key" : {
			"_id" : 1
		},
		"name" : "_id_",
		"ns" : "xhprof.results"
	},
	{
		"v" : 2,
		"key" : {
			"meta.SERVER.REQUEST_TIME" : -1
		},
		"name" : "meta.SERVER.REQUEST_TIME_-1",
		"ns" : "xhprof.results"
	},
	{
		"v" : 2,
		"key" : {
			"profile.main().wt" : -1
		},
		"name" : "profile.main().wt_-1",
		"ns" : "xhprof.results"
	},
	{
		"v" : 2,
		"key" : {
			"profile.main().mu" : -1
		},
		"name" : "profile.main().mu_-1",
		"ns" : "xhprof.results"
	},
	{
		"v" : 2,
		"key" : {
			"profile.main().cpu" : -1
		},
		"name" : "profile.main().cpu_-1",
		"ns" : "xhprof.results"
	},
	{
		"v" : 2,
		"key" : {
			"meta.url" : 1
		},
		"name" : "meta.url_1",
		"ns" : "xhprof.results"
	}
]


2. Startup the containers: `docker-compose up -d`

3. Open your browser at http://xhgui.127.0.0.1.xip.io:8142 or just http://localhost:8142
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is xip.io?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://xip.io/

wildcard DNS for everyone 
    
What is xip.io?

xip.io is a magic domain name that provides wildcard DNS
for any IP address. Say your LAN IP address is 10.0.0.1.
Using xip.io,

          10.0.0.1.xip.io   resolves to   10.0.0.1
      www.10.0.0.1.xip.io   resolves to   10.0.0.1
   mysite.10.0.0.1.xip.io   resolves to   10.0.0.1
  foo.bar.10.0.0.1.xip.io   resolves to   10.0.0.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! thanks for sharing.

@markstory markstory merged commit 990b6ea into perftools:master Mar 27, 2019
@glensc glensc deleted the docker-stab2 branch March 27, 2019 18:30
@glensc
Copy link
Contributor Author

glensc commented Mar 27, 2019

thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants