Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.github
.env
.env.*
node_modules
dist
coverage
npm-debug.log*
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
integration:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -39,6 +40,9 @@ jobs:
DATABASE_URL: postgresql://wraith:wraith@localhost:55432/wraith_test
DIRECT_DATABASE_URL: postgresql://wraith:wraith@localhost:55432/wraith_test
INTEGRATION_API_URL: http://localhost:3300
- name: Show container logs on failure
if: failure()
run: docker compose -f docker-compose.test.yml logs --no-color
- name: Tear down integration stack
if: always()
run: docker compose -f docker-compose.test.yml down -v
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ── Stage 1: Install all deps + build TypeScript ─────────────────────────────
FROM node:20-alpine AS builder

RUN apk add --no-cache openssl

WORKDIR /app
COPY package*.json ./
RUN npm ci
Expand All @@ -12,6 +14,8 @@ RUN npm run build
# ── Stage 2: Production-only image ────────────────────────────────────────────
FROM node:20-alpine AS runner

RUN apk add --no-cache openssl

WORKDIR /app

# The app runs Prisma schema sync on startup, so the runtime image needs the
Expand All @@ -23,4 +27,8 @@ RUN npm ci
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma

# npm ci installs @prisma/client into a fresh node_modules directory in this
# stage, so generate the client here as well as in the builder stage.
RUN npm run db:generate

CMD ["node", "dist/index.js"]
Loading