Hello! I'm relatively new to Docker, and am trying to figure out how to correctly configure a new service to deploy. I've tried following advice from Railway docs and Turborepo docs but I think they both expect slightly different situations and aren't exactly compatible.
When I deploy, I'm seeing the Dockerfile fail with these errors:
#9 ERROR: failed to calculate checksum of ref kejf4w0mdb0avf096x2aemhwz::x4pxm5rhocxskoqbdv2joedda: "/apps/0x57-api/package.json": not found
#10 ERROR: failed to calculate checksum of ref kejf4w0mdb0avf096x2aemhwz::x4pxm5rhocxskoqbdv2joedda: "/bun.lockb": not found
My Dockerfile is located in apps/0x57-api/Dockerfile and looks like this:
FROM oven/bun:1
WORKDIR /usr/src/app
ENV NODE_ENV=production
# Turbo Remote Cache Setup
ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM
ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN
# Once Turbo supports Bun Prune, we can do additional performance improvements here.
# https://turbo.build/repo/docs/guides/tools/docker
# Copy files
COPY package.json ./
COPY bun.lockb ./
COPY apps/0x57-api/package.json ./apps/0x57-api/package.json
COPY . .
RUN bun install --frozen-lockfile --production
EXPOSE 3030/tcp
WORKDIR /usr/src/app/apps/0x57-api
RUN [ "bun", "start" ]
My Railway configuration file is located in apps/0x57-api/railway.json:
{
"$schema": "https://railway.com/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "apps/0x57-api/Dockerfile",
"watchPatterns": ["apps/0x57-api/**/*", "packages/**/*"]
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 3,
"healthcheckPath": "/health",
"healthcheckTimeout": 50
}
}
The error makes me think file paths are wrong. The dockerfile builds locally.