| 1 | import { bucket, defineRailway, github, image, postgres, preserve, project, service, volume } from "railway/iac"; |
| 2 | |
| 3 | export default defineRailway(() |
| 4 | const ghost = |
| 5 | |
| 6 | const postgresDatabase = |
| 7 | postgresDatabase.networking = |
| 8 | const postgresVolumeUO8m = |
| 9 | const ghostBucket = |
| 10 | const web = |
| 11 | source: ghost, |
| 12 | build: { buildEnvironment: " |
| 13 | replicas: { "asia-southeast1-eqsg3a": |
| 14 | deploy: { sleepApplication: true |
| 15 | domains: ["web.ghost.procrastinator.fyi"], |
| 16 | env: { NEXT_PUBLIC_API_URL: preserve |
| 17 | }); |
| 18 | const docs = |
| 19 | source: ghost, |
| 20 | build: { buildEnvironment: " |
| 21 | replicas: { "asia-southeast1-eqsg3a": |
| 22 | deploy: { sleepApplication: true |
| 23 | domains: ["docs.ghost.procrastinator.fyi"], |
| 24 | env: { NEXT_PUBLIC_DOCS_URL: preserve |
| 25 | }); |
| 26 | const api = |
| 27 | source: ghost, |
| 28 | build: { buildEnvironment: " |
| 29 | healthcheck: "/api", |
| 30 | healthcheckTimeout: 60, |
| 31 | preDeploy: "node packages/db/dist/migrate.js", |
| 32 | // Keep at 1: deleting a repository purges only the local git cache of the replica that handles the request (docs/0020). |
| 33 | replicas: { "asia-southeast1-eqsg3a": |
| 34 | deploy: { restartPolicyMaxRetries: 5 |
| 35 | domains: ["api.ghost.procrastinator.fyi"], |
| 36 | networking: { tcpProxies: { |
| 37 | env: { AUTH_COOKIE_DOMAIN: preserve |
| 38 | }); |
| 39 | const zoekt = |
| 40 | source: ghost, |
| 41 | build: { buildEnvironment: " |
| 42 | healthcheck: "/healthz", |
| 43 | replicas: { "asia-southeast1-eqsg3a": |
| 44 | env: { S3_ACCESS_KEY_ID: preserve |
| 45 | }); |
| 46 | const otelLgtm = |
| 47 | source: image("grafana/otel-lgtm |
| 48 | replicas: { "asia-southeast1-eqsg3a": |
| 49 | deploy: { sleepApplication: true |
| 50 | env: { GF_SECURITY_ADMIN_PASSWORD: preserve |
| 51 | }); |
| 52 | |
| 53 | return project("Ghost |
| 54 | resources: [web, |
| 55 | }); |
| 56 | }); |