docs/current_docs/using-dagger/services.mdx
Start all services defined in your workspace:
dagger up
Services run in ephemeral containers. Their ports are tunneled to your local machine. Stop with Ctrl+C.
dagger up -l # list available services
dagger up web # start only the 'web' service
dagger up web api redis # start multiple services
Service containers have three key properties:
A service defined in a module can be exposed to your local machine:
# Start an HTTP service and access it locally
dagger up web
curl http://localhost:80
Containers running in Dagger can also connect to services on your host machine. This is useful for testing against a locally running database or API.
A function exposes a host service by accepting it as an argument, using the tcp:// or udp:// provider to point at a host port:
# Make a database running on the host reachable from the function
dagger call integration-test --db=tcp://localhost:5432
Inside the function the argument is an ordinary Service, so the same code works whether the upstream runs on your host or in another container.