Skip to content

Commit dd2a2ac

Browse files
committed
doc: Add instruction for running tunnel
1 parent b8a1f14 commit dd2a2ac

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

references/README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,31 @@ This guide assumes that you have followed the [Contributing.md](https://github.c
5252

5353
#### Step-by-Step Instructions
5454

55-
1. **Run the webapp on localhost**:
55+
1. **Run a http tunnel**:
56+
You will need to run a http tunnel to expose your local webapp, it is required for some API calls during building the image to deploy on your local instance. This is *optional* if you do not plan to test deployment on your local instance.
57+
- Download the ngrok CLI. This can be done by following the instructions on ngrok's [website](https://ngrok.com/docs/getting-started/).
58+
- Create an account on ngrok to obtain the authtoken and add it to the CLI.
59+
```
60+
ngrok config add-authtoken <your-auth-token>
61+
```
62+
Replace the <your-auth-token> with the token you obtain from ngrok.
63+
- Run the tunnel.
64+
```
65+
ngrok http <your-app-port>
66+
```
67+
Replace the <your-app-port> with the webapp port, default is `3030`.
68+
69+
2. **Add your tunnel URL to the env**:
70+
After running the ngrok tunnel, you will see URL in your terminal, it will look something like `https://<your-tunnel-address>.ngrok-free.app`.
71+
Replace the `APP_ORIGIN` variable with this URL in your `.env` file in the root of the trigger.dev project.
72+
73+
3. **Run the webapp on localhost**:
5674

5775
```
5876
pnpm run dev --filter webapp --filter coordinator --filter docker-provider
5977
```
6078

61-
2. **Build the CLI in a new terminal window**:
79+
4. **Build the CLI in a new terminal window**:
6280

6381
```
6482
# Build the CLI
@@ -68,34 +86,42 @@ pnpm run build --filter trigger.dev
6886
pnpm i
6987
```
7088

71-
3. **Set up a new project in the webapp**:
89+
5. **Set up a new project in the webapp**:
7290
- Open the webapp running on `localhost:3030`.
7391
- Create a new project in the webapp UI.
7492
- Go to the *Project Settings* page and copy the project reference id from there.
7593

76-
4. **Copy the hello-world project as a template**:
94+
6. **Copy the hello-world project as a template**:
7795

7896
```
7997
cp -r references/hello-world references/<new-project>
8098
```
8199

82100
Replace `<new-project>` with your desired project name.
83101

84-
5. **Update project details**:
102+
7. **Update project details**:
85103
- Open `<new-project>/package.json` and change the name field.
86104
*(Tip: Use the same name as in the webapp to avoid confusion.)*
87105

88106
- Open `<new-project>/trigger.config.ts` and update the project field with the project reference you copied from the webapp.
89107

90-
6. **Authorize the CLI for your project**:
108+
- Run `pnpm i` in your `<new-project>` directory to sync the dependencies.
109+
110+
8. **Authorize the CLI for your project**:
91111

92112
```
93113
pnpm exec trigger login -a http://localhost:3030 --profile local
94114
```
95115

96-
7. **Run the new project**:
116+
9. **Run the new project**:
97117
You can now run your project using the CLI with the following command:
98118

99119
```
100120
pnpm exec trigger dev --profile local
101121
```
122+
123+
You can also deploy them against your local instance with the following command:
124+
125+
```
126+
pnpm exec trigger deploy --self-hosted --load-image --profile local
127+
```

0 commit comments

Comments
 (0)