adorable-boots-9466
01/30/2024, 5:07 AMchilly-king-10285
01/30/2024, 5:07 AMchilly-king-10285
01/30/2024, 5:07 AMentrypoint.sh
file: 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: 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)chilly-king-10285
01/30/2024, 5:08 AMchilly-king-10285
01/30/2024, 5:08 AMentrypoint.sh
file: 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: 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)adorable-boots-9466
01/30/2024, 5:09 AMchilly-king-10285
01/30/2024, 5:09 AMchilly-king-10285
01/30/2024, 5:09 AMbash # 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)