<@U04UQ68083H> Is there a way to authenticate with...
# ory-copilot
a
@chilly-king-10285 Is there a way to authenticate with Ory CLI in a non-interactive way? We'd like to automate the authentication when running Ory Tunnel as a background process in a dockerized application
c
A message from kapa.ai
Based on the provided extracts, there is no direct information about non-interactive authentication with Ory CLI. However, you can run Ory Proxy as a background process in a Docker container along with your application. This is done by adding both your application and Ory Proxy to a single Docker container. Here is an example of how you can set this up: First, create an
entrypoint.sh
file:
Copy code
bash #!/bin/bash   set -e      # This assumes that your server is running on port 3000. If it's running on a different port,   # remember to adjust the command to point to the port where your server is running at!   ory proxy --port 8080 <http://127.0.0.1:3000> <https://your-domain.com> &      # This should be your server command   node your-entrypoint.js      # Or, depending on the tech you use:   # go run main.go   # php index.php   # ...
Then, add the script to your Dockerfile and run it:
Copy code
dockerfile # ...      EXPOSE 8080      COPY ./docker-entrypoint.sh /   ENTRYPOINT ["/docker-entrypoint.sh"]
Please note that this isn't a perfect solution as Docker watches the processes running in the foreground. When a process crashes, Docker notifies just of the failures of the foreground process and gives no information about the background process. In this example, Ory Proxy is the background process. For more information about running multiple processes in a single container, you can refer to the [Docker documentation](https://docs.docker.com/config/containers/multi-service_container/). Source: [Ory Documentation](https://www.ory.sh/docs/guides/cli/proxy-and-tunnel#use-ory-proxy-in-docker)
A message from kapa.ai
Based on the provided extracts, there is no direct information about non-interactive authentication with Ory CLI. However, you can run Ory Proxy as a background process in a Docker container along with your application. This is done by adding both your application and Ory Proxy to a single Docker container. Here is an example of how you can set this up: First, create an
entrypoint.sh
file:
Copy code
bash #!/bin/bash   set -e      # This assumes that your server is running on port 3000. If it's running on a different port,   # remember to adjust the command to point to the port where your server is running at!   ory proxy --port 8080 <http://127.0.0.1:3000> <https://your-domain.com> &      # This should be your server command   node your-entrypoint.js      # Or, depending on the tech you use:   # go run main.go   # php index.php   # ...
Then, add the script to your Dockerfile and run it:
Copy code
dockerfile # ...      EXPOSE 8080      COPY ./docker-entrypoint.sh /   ENTRYPOINT ["/docker-entrypoint.sh"]
Please note that this isn't a perfect solution as Docker watches the processes running in the foreground. When a process crashes, Docker notifies just of the failures of the foreground process and gives no information about the background process. In this example, Ory Proxy is the background process. For more information about running multiple processes in a single container, you can refer to the [Docker documentation](https://docs.docker.com/config/containers/multi-service_container/). Source: [Ory Documentation](https://www.ory.sh/docs/guides/cli/proxy-and-tunnel#use-ory-proxy-in-docker)
a
@chilly-king-10285 What if I want to run Ory CLI in a standalone container?
c
A message from kapa.ai
You can run the Ory CLI in a standalone Docker container. Here's how you can pull the Ory CLI image and run a CLI command:
Copy code
bash # Pull Ory CLI image   docker pull oryd/ory      # Run image, enter container, and run a CLI command   docker run --rm -it oryd/ory help
This will pull the Ory CLI Docker image and run the
ory help
command inside the container. Source: [Ory Documentation](https://www.ory.sh/docs/guides/cli/installation)