Skip to content

Commit

Permalink
Merge pull request #4 from railwayapp/basic-documentation-site
Browse files Browse the repository at this point in the history
basic documentation site
  • Loading branch information
coffee-cup authored Jan 30, 2025
2 parents 0f36f00 + d92d779 commit a15b4b7
Show file tree
Hide file tree
Showing 40 changed files with 1,836 additions and 8 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ _Huge work in progress_
- [x] Build LLB with a Buildkit client
- [x] Buildkit frontend that can be used as an image
- [x] Optimized build plan to LLB generation
- [ ] Solidify build plan configuration
- [ ] Support configuring Railpack with a config file
- [x] Solidify build plan configuration
- [x] Support configuring Railpack with a config file

## Architecture

Expand All @@ -26,7 +26,6 @@ _Huge work in progress_
- We look for a `rpk.json` file, which is a serialized build plan
- We convert the build plan to LLB and return it


## Usage

Railpack can currently be used to ① build an image with BuildKit directly, or ② as a custom BuildKit frontend.
Expand Down Expand Up @@ -82,7 +81,6 @@ To update the frontend image, you can run
mise run build-and-push-frontend
```


### References

#### Run BuildKit Locally
Expand Down
21 changes: 21 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
4 changes: 4 additions & 0 deletions docs/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
37 changes: 37 additions & 0 deletions docs/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# global options
{
admin off # theres no need for the admin api in railway's environment
persist_config off # storage isn't persistent anyway
auto_https off # railway handles https for us, this would cause issues if left enabled
# runtime logs
log {
format json # set runtime log format to json mode
}
# server options
servers {
trusted_proxies static private_ranges # trust railway's proxy
}
}

# site block, listens on the $PORT environment variable, automatically assigned by railway
:{$PORT} {
# access logs
log {
format json # set access log format to json mode
}

# health check for railway
respond /health 200

# serve from the 'dist' folder (Vite builds into the 'dist' folder)
root * dist

# enable gzipping responses
encode gzip

# serve files from 'dist'
file_server

# if path doesn't exist, redirect it to 'index.html' for client side routing
try_files {path}.html
}
54 changes: 54 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Starlight Starter Kit: Basics

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
npm create astro@latest -- --template starlight
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:

```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ └── content.config.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
104 changes: 104 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// @ts-check
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "Railpack Docs",
social: {
github: "https://github.com/railwayapp/railpack",
},
customCss: [
// Path to your Tailwind base styles:
"./src/tailwind.css",

// Fontsource files for to regular and semi-bold font weights.
"@fontsource/inter/400.css",
"@fontsource/inter/600.css",
],
sidebar: [
{
label: "Getting Started",
link: "/getting-started",
},
{
label: "Installation",
link: "/installation",
},
{
label: "Guides",
items: [
{
label: "Building with CLI and BuildKit",
link: "/guides/building-with-cli",
},
{
label: "Building with a Custom Frontend",
link: "/guides/custom-frontend",
},
{
label: "Developing Locally",
link: "/guides/developing-locally",
},
],
},
{
label: "Configuration",
items: [
{ label: "Configuration File", link: "/config/file" },
{
label: "Environment Variables",
link: "/config/environment-variables",
},
],
},
{
label: "Languages",
items: [
{ label: "Node.js", link: "/languages/node" },
{ label: "Python", link: "/languages/python" },
{ label: "Go", link: "/languages/golang" },
{ label: "PHP", link: "/languages/php" },
],
},
{
label: "Reference",
items: [
{ label: "CLI Commands", link: "/reference/cli" },
{ label: "Configuration File", link: "/reference/config" },
],
},
{
label: "Architecture",
items: [
{ label: "High Level Overview", link: "/architecture/overview" },
{
label: "Package Resolution",
link: "/architecture/package-resolution",
},
{ label: "Plan Generation", link: "/architecture/plan-generation" },
{ label: "Secrets and Environment", link: "/architecture/secrets" },
{
label: "Previous Versions",
link: "/architecture/previous-versions",
},
{ label: "BuildKit Generation", link: "/architecture/buildkit" },
{ label: "Caching", link: "/architecture/caching" },
],
},
{
label: "Contributing",
link: "/contributing",
},
],
}),
tailwind({
// Disable the default base styles:
applyBaseStyles: false,
}),
],
});
Loading

0 comments on commit a15b4b7

Please sign in to comment.