Skip to content

Commit d9bd023

Browse files
committed
api: self-contained Dockerfile for Railway (context services/api)
1 parent b9964eb commit d9bd023

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

‎services/api/Dockerfile‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
# TronBrowser auth/sync API. Built from the monorepo root context.
1+
# TronBrowser auth/sync API. Self-contained build (context = services/api), so
2+
# it doesn't pick up the repo-root Caddy Dockerfile. Railway: set this service's
3+
# Root Directory to "services/api". Migrations are applied separately
4+
# (`doppler run -- pnpm db:migrate`); the container just serves.
25
FROM node:24-slim
3-
RUN corepack enable
46
WORKDIR /app
57

6-
# Workspace manifests first for cached installs.
7-
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml .npmrc ./
8-
COPY services/api/package.json services/api/package.json
9-
RUN pnpm install --frozen-lockfile --filter @tronbrowser/api...
8+
COPY package.json ./
9+
RUN npm install --no-audit --no-fund
1010

11-
COPY . .
12-
RUN pnpm --filter @tronbrowser/api build
11+
COPY src ./src
12+
# Standalone tsconfig (the repo one extends ../../tsconfig.base.json).
13+
RUN printf '%s' '{"compilerOptions":{"target":"ES2023","module":"NodeNext","moduleResolution":"NodeNext","outDir":"dist","rootDir":"src","strict":true,"skipLibCheck":true,"esModuleInterop":true},"include":["src"]}' > tsconfig.build.json \
14+
&& npx tsc -p tsconfig.build.json
1315

1416
ENV PORT=8080
1517
EXPOSE 8080
16-
# Apply migrations, then start the server.
17-
CMD ["sh", "-c", "node scripts/db-migrate.mjs && node services/api/dist/index.js"]
18+
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)