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: docs/concepts/railpack.md
+44-19Lines changed: 44 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ description: Defang will use Railpack to make an OCI-Compliant container image f
4
4
sidebar_position: 500
5
5
---
6
6
7
-
8
-
9
7
# Railpack
10
8
11
9
[Railpack](https://railpack.com/) is a tool for building container images from source code with minimal configuration. It is the successor to [Nixpacks](https://nixpacks.com/) and incorporates several lessons learned from running Nixpacks in production at [Railway](https://railway.com/) over the years.
@@ -16,10 +14,10 @@ In Defang deployments, one of the most common points of failure is a missing or
16
14
17
15
When you run a Defang Railpack deployment you need 2 components:
18
16
19
-
A working application
20
-
A valid compose file
17
+
1.A working application
18
+
2.A valid Compose file
21
19
22
-
Your compose file should not mention a Dockerfile.
20
+
Your Compose file should not mention a Dockerfile.
23
21
24
22
For example,
25
23
@@ -48,14 +46,16 @@ If the deployment fails, here are some things you can try.
48
46
49
47
To allow Railpack to generate a build plan for your project, please structure it to include the following files, or rename existing ones to be compatible.
50
48
51
-
#### Node
49
+
#### [Node](https://railpack.com/languages/node/)
52
50
53
51
Your project will be detected as a Node.js application if a `package.json` file exists in the root directory.
54
52
55
-
Here is an example of a Railpack ready NextJS project.
56
-
Here is an example of a Railpack ready React Vite project.
53
+
Here is an example of:
54
+
55
+
- A Railpack-ready [React Vite project](https://github.com/DefangLabs/samples/tree/main/samples/react-vite-railpack)
56
+
- A Railpack-ready [NextJS project](https://github.com/DefangLabs/samples/tree/main/samples/nextjs-railpack)
Railpack can automatically build and setup a server for static sites that require no build steps. The [Caddy](https://caddyserver.com/) server is used as the underlying web server.
115
119
@@ -119,3 +123,24 @@ Your project will be automatically detected as a static site if any of these con
119
123
- An index.html file exists in the root directory
120
124
- A public directory exists
121
125
- The `RAILPACK_STATIC_FILE_ROOT` environment variable is set
126
+
127
+
Static sites are served using the Caddy web server and you need to have the environment variable `PORT` exposed like this in the Compose file to map to the correct port:
0 commit comments