Jay
Jay
Explore posts from servers
RRailway
Created by Jay on 9/15/2024 in #✋|help
Getting a 500 error code when deploying
Are there any alternatives to deploying a monorepo? I’m using GitHub actions to test/deploy applications
13 replies
RRailway
Created by Jay on 9/15/2024 in #✋|help
Getting a 500 error code when deploying
Yeah that’s it, it’s ~45 mb
13 replies
RRailway
Created by Jay on 9/15/2024 in #✋|help
Getting a 500 error code when deploying
But each service is deployed independently via docker
13 replies
RRailway
Created by Jay on 9/15/2024 in #✋|help
Getting a 500 error code when deploying
A fairly large monorepo, do you want the data in bytes?
13 replies
RRailway
Created by Jay on 9/15/2024 in #✋|help
Getting a 500 error code when deploying
3b940ed6-960b-451c-a8cb-ae856e2595a5
13 replies
RRailway
Created by Jay on 8/10/2024 in #✋|help
Caddy server not receiving "accept-encoding" headers correctly
3b940ed6-960b-451c-a8cb-ae856e2595a5
4 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
ah that's great! thanks @Brody.
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
or is it path to the directory to be deployed? sorry if I might have misunderstood it.
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
No description
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
Basically yeah the config just holds where the docker file is relative to the project
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
I found the usage of path from these docs here: https://docs.railway.app/reference/cli-api#up.
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
No description
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
okay, just a sec
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
would it be okay to share the service name and environment here? that's the only redacted thing besides the terminal location
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
No description
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
There aren't any build logs when I'm making these changes but here's the previous versions build logs if it helps
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
Sorry but the issue is that the build isn't even getting started since I'm deploying via the CLI only and the service isn't associated with a Git repo.
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
how can I do so? the railway up command's first output is the 'prefix not found' message and then it quits before getting to docker build. Is there another way besides it to check it?
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
Hey @Brody , sorry for the late reply but here it is railway.json
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"dockerfilePath": "docker/prod/api/Dockerfile.api"
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"dockerfilePath": "docker/prod/api/Dockerfile.api"
}
}
Dockerfile
FROM node:20-alpine AS alpine
RUN apk add --no-cache libc6-compat
RUN apk update

# Setup pnpm and turbo on the alpine base
FROM alpine as base
RUN npm install pnpm turbo --global
RUN pnpm config set store-dir ~/.pnpm-store

# Prune projects
FROM base AS pruner

ARG PROJECT="@repo/api"

WORKDIR /app
COPY . .
RUN turbo prune --scope=${PROJECT} --docker

# Build the project
FROM base AS builder
ARG PROJECT="@repo/api"

WORKDIR /app

# Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# First install the dependencies (as they change less often)
RUN pnpm install --frozen-lockfile

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .

# Env vars required to build the project
ARG DATABASE_URL
ARG RESEND_KEY
ARG BUILD_ENV

RUN turbo build:${BUILD_ENV} --filter=${PROJECT}
RUN rm -rf ./node_modules
RUN pnpm install --prod --frozen-lockfile

# Final image
FROM alpine AS runner

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
USER nodejs

WORKDIR /app
COPY --from=builder --chown=nodejs:nodejs /app .
WORKDIR /app/apps/api

ARG PORT=8080
ENV PORT=${PORT}

CMD ["node","dist/index.js"]
FROM node:20-alpine AS alpine
RUN apk add --no-cache libc6-compat
RUN apk update

# Setup pnpm and turbo on the alpine base
FROM alpine as base
RUN npm install pnpm turbo --global
RUN pnpm config set store-dir ~/.pnpm-store

# Prune projects
FROM base AS pruner

ARG PROJECT="@repo/api"

WORKDIR /app
COPY . .
RUN turbo prune --scope=${PROJECT} --docker

# Build the project
FROM base AS builder
ARG PROJECT="@repo/api"

WORKDIR /app

# Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# First install the dependencies (as they change less often)
RUN pnpm install --frozen-lockfile

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .

# Env vars required to build the project
ARG DATABASE_URL
ARG RESEND_KEY
ARG BUILD_ENV

RUN turbo build:${BUILD_ENV} --filter=${PROJECT}
RUN rm -rf ./node_modules
RUN pnpm install --prod --frozen-lockfile

# Final image
FROM alpine AS runner

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
USER nodejs

WORKDIR /app
COPY --from=builder --chown=nodejs:nodejs /app .
WORKDIR /app/apps/api

ARG PORT=8080
ENV PORT=${PORT}

CMD ["node","dist/index.js"]
For some more context, this used to work when I only had a single service I wanted to deploy to railway and had the same config in root of the monorepo. But I want to add multiple services to railway with each having their own Dockerfile and thats where it is starting to break.
29 replies
RRailway
Created by Jay on 4/18/2024 in #✋|help
Getting a "prefix not found" error when running railway up
033f39f1-9797-405f-88f8-343ca4ac4254
29 replies