You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/enterprise/self-hosted-set-up.mdx
+106-1Lines changed: 106 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Before setting up self-hosted documentation, ensure you have:
12
12
- Access to your Fern project's `fern/` directory
13
13
- A Docker Hub account (for accessing the private image)
14
14
15
+
## Setup instructions
16
+
15
17
<Steps>
16
18
<Steptitle="Request Access to the Docker Image">
17
19
@@ -47,10 +49,16 @@ In the directory containing your `fern/` folder, create a new `Dockerfile` with
47
49
FROM fernapi/fern-self-hosted:<latest-tag>
48
50
49
51
COPY fern/ /fern/
52
+
53
+
RUN fern-generate
50
54
```
51
55
52
56
Replace `<latest-tag>` with the actual tag used in the previous step.
53
57
58
+
<Info>
59
+
`fern-generate` processes your documentation at build time, enabling faster container startup, air-gapped deployment, and a smaller attack surface. You can alternatively [defer generation to runtime](#runtime-generation).
60
+
</Info>
61
+
54
62
</Step>
55
63
<Steptitle="Build Your Custom Docker Image">
56
64
@@ -93,5 +101,102 @@ instances:
93
101
You can now deploy the image to your own infrastructure, allowing you to host the documentation on your own domain.
94
102
95
103
</Step>
96
-
</Steps>
104
+
</Steps>
105
+
106
+
## Additional configuration
107
+
108
+
The following sections cover optional configurations for specific deployment scenarios.
109
+
110
+
### Runtime generation
111
+
112
+
By default, `fern-generate` runs at Docker build time. Defer generation to runtime if you need to:
113
+
- Pass configuration (environment variables, secrets) at runtime
114
+
- Speed up Docker builds during development
115
+
- Share a single image across multiple documentation configurations
116
+
117
+
Use the `--only-deps` flag to defer generation to runtime:
118
+
119
+
```dockerfile
120
+
FROM fernapi/fern-self-hosted:<latest-tag>
121
+
122
+
COPY fern/ /fern/
123
+
124
+
RUN fern-generate --only-deps
125
+
```
126
+
127
+
This starts required services (PostgreSQL, MinIO, FDR) at build time but skips documentation generation. When the container starts, it automatically runs `fern generate --docs`.
128
+
129
+
<Warning>
130
+
Runtime generation requires network access at container startup. For air-gapped deployments, use the default build-time generation.
131
+
</Warning>
132
+
133
+
### Air-gapped deployments with gRPC
134
+
135
+
If your API uses gRPC with dependencies from the [Buf Schema Registry](https://buf.build) (BSR), the `buf` CLI fetches modules from `buf.build` during generation. This fails in air-gapped environments without network access.
136
+
137
+
<Steps>
138
+
<Step title="Check for BSR dependencies">
139
+
140
+
Look for a `deps` section in your `buf.yaml` file:
141
+
142
+
```yaml
143
+
version: v2
144
+
deps:
145
+
- buf.build/googleapis/googleapis
146
+
- buf.build/grpc-ecosystem/grpc-gateway
147
+
```
148
+
149
+
If there's no `deps` section or only local paths, you can skip the rest of this section.
0 commit comments