CoCa
CoCa
RRailway
Created by CoCa on 12/14/2023 in #✋|help
Multiple Services in `railway.toml` ?
Is it possible to specify multiple services in a railway.toml file? For example if I want to setup a backend service and a frontend service, can I do that from one file or is it 100% scoped to just one service?
# backend service
[build]
builder = "nixpacks"
buildCommand = "go build -o output"

[deploy]
startCommand = "./output"
restartPolicyType = "never"

--

# frontend service
[build]
builder = "nixpacks"
buildCommand = "npm run build"

[deploy]
startCommand = "node ./build/index.js"
restartPolicyType = "never"
# backend service
[build]
builder = "nixpacks"
buildCommand = "go build -o output"

[deploy]
startCommand = "./output"
restartPolicyType = "never"

--

# frontend service
[build]
builder = "nixpacks"
buildCommand = "npm run build"

[deploy]
startCommand = "node ./build/index.js"
restartPolicyType = "never"
14 replies
RRailway
Created by CoCa on 11/6/2023 in #✋|help
Railway go-mux template question / Railway Headers?
I just wanted to reach out to ask a quick question about the go-mux template for Railway. This PrivateRanges middleware - are these CIDRs listed the ones for Railway? https://github.com/railwayapp-templates/go-mux/blob/main/internal/middleware/trustproxy.go#L19-L28 I'm thinking about having a Go server similar to this and I only want to accept traffic from Railway IPs, or if possible, my own Project IDs. Is there a quick list of headers / IPs / other stuff injected by Railway that I can use to validate that a request came from Railway or one of my projects? essentially I'd want to block anything not originating from a "blessed list" of my own trusted projects
12 replies
RRailway
Created by CoCa on 11/3/2023 in #✋|help
Railway Private Networking
This morning I checked my usage and saw a large jump in the estimated monthly cost (egress) for one of my projects and I'm looking to update so that the network communication between my stuff is over the private network. I have a SvelteKit web UI that I'm updating to make API calls to my Golang REST API on the server-side using the provided private *.railway.internal URL, however, the requests are failing because both port 443 and 80 are ERRCONNREFUSED, so I'd like help with that. Also, the Golang REST API connects to a PostgreSQL (TimescaleDB) instance, and I would like some help figuring out how to connect from my REST API to the database over private network as well! Cheers! 😃
82 replies
RRailway
Created by CoCa on 10/21/2023 in #✋|help
Static Site using Nginx + Railway domain not loading
I have a SvelteKit static site I'm trying to deploy using this Dockerfile:
FROM node:alpine3.18 as builder
RUN mkdir /code
WORKDIR /code
COPY . /code
RUN npm install
RUN npm run build

FROM nginx:alpine3.18-slim
COPY --from=builder /code/dist /usr/share/nginx/html
FROM node:alpine3.18 as builder
RUN mkdir /code
WORKDIR /code
COPY . /code
RUN npm install
RUN npm run build

FROM nginx:alpine3.18-slim
COPY --from=builder /code/dist /usr/share/nginx/html
(somewhat copied from here - https://github.com/railwayapp-templates/nginx/blob/main/Dockerfile) The build + deploy succeeded, and I generated a railway domain for it but I'm only seeing the "Application failed to respond" page. Is there something network-related I'm missing?
17 replies
RRailway
Created by CoCa on 5/11/2023 in #✋|help
Custom Domain HTTPS TLS Cert invalid
Project ID: 81d08146-e275-403d-8a25-046edbf806f6 I have a domain purchased on Google Domains that I'd like to forward to my Railway deployment. I created two custom domains for this, one prefixed with www. and that worked fine with setting up a CNAME from Google Domains. The 2nd is the root domain itself, and I set up an A record in Google Domains with the IP address of the second custom domain (for the root domain) from Railway. This domain when accessed in the browser shows HTTPS TLS Cert invalid since it matches *.up.railway.app Is this something that takes a while to sync up? Did I do something incorrectly? (not confident about the A record approach, since I wasn't able to setup a CNAME for the root domain)
23 replies