local dev environment using docker containers, defined in docker-compose
Mark Lightfoot a5d7c070b9 initial | 5 anos atrás | |
---|---|---|
db | 5 anos atrás | |
src | 5 anos atrás | |
README.md | 5 anos atrás | |
docker-compose.yaml | 5 anos atrás |
This is a quick example that allows live development on a server. This is very basic and lacks a number of features that would be on an average site (eg fastcgi, redis, etc).
It is accessible on localhost:80
This is standard sql to create a database to work off. In the example of cloudM, you'd have an SQL dump or such here to populate the DB. This is referenced in docker-compose.yaml
volumes:
- "./db/:/docker-entrypoint-initdb.d"
With the specific image used (mysql:5.7) anything placed in the container at docker-entrypoint-initdb.d will be ran as sql files when the database has been created.
Code lives here. The example here is a simple php file to pull some data from the DB and display it. it is mounted in the docker-compose.yaml so thus can edited on-the-fly without restarts.
defines how everything meshes together. run the command docker-compose up
to bring it all live, with down to tear it away.
build:
context: .
dockerfile: web-dockerfile
This defines that the image will be built from a file within the current directory, with web-dockerfile being the Dockerfile.
Creates the docker image. It uses an image from the dockerhub, updates and then enables the mysqli module for php to allow connections. The command `docker-php-ext-install X' is provided by the creators of the docker image.