This repository demonstrates how to use pdeploy to manage and expose services using Docker Compose.
- Automatic Builds: Define your build context in
docker-compose.ymlandpdeploywill handle the image creation. - HTTP Exposure: Easily expose services to the internet using standard Traefik labels.
- Service Orchestration: Use multi-service Compose files to manage complex applications.
You can build your own applications directly from source by specifying a build context in your docker-compose.yml. This allows for a seamless "git push to deploy" workflow where the container image is built on the server.
Example from echo service:
services:
echo:
build: .
# ... rest of configurationIn this example, pdeploy will use the local Dockerfile to build the application before deploying it.
pdeploy provides an ingress controller, by default Traefik. To expose a service, you need to:
- Connect the service to the
pdeploy-ingressnetwork. - Provide the necessary labels for routing.
services:
echo:
build: .
networks:
- default
- pdeploy-ingress
labels:
traefik.enable: true
traefik.http.routers.echo.rule: Host(`echo-<user>.pdeploy.mik.qa`)
networks:
pdeploy-ingress:
external: truetraefik.enable=true: Tells the ingress controller to manage this service.traefik.http.routers.<name>.rule=Host(...): Defines the domain name where the service will be accessible.
By default, *-<user>.pdeploy.mik.qa is forwarded to your pdeploy instance.
You can add a custom domain to pdeploy by using the following:
ssh pdeploy add-custom-domain example.comYou can now use example.com in the router rule.
git remote add pdeploy ssh://pdeploy.mik.qa:2222/user/project.git
git push pdeploy mainMore commands are available from ssh pdeploy.mik.qa -p 2222 help