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
16 changes: 15 additions & 1 deletion indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine
FROM node:20-alpine AS builder

RUN apk add --no-cache openssl

Expand All @@ -13,8 +13,22 @@ RUN npx prisma generate
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
RUN npm prune --omit=dev

FROM node:20-alpine AS runner

RUN apk add --no-cache openssl

WORKDIR /app
ENV NODE_ENV=production

RUN addgroup -S -g 1001 app && adduser -S -u 1001 -G app app

COPY --from=builder --chown=app:app /app/package.json ./package.json
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
COPY --from=builder --chown=app:app /app/prisma ./prisma
COPY --from=builder --chown=app:app /app/dist ./dist

USER app

CMD ["sh", "-c", "npx prisma migrate deploy && exec node dist/index.js"]
9 changes: 1 addition & 8 deletions indexer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"dependencies": {
"@prisma/client": "^5.20.0",
"@stellar/stellar-sdk": "^16.2.0",
"prisma": "^5.20.0",
"prom-client": "^15.1.3"
},
"devDependencies": {
"@types/node": "^20.0.0",
"eslint": "^9.0.0",
"prisma": "^5.20.0",
"tsx": "^4.19.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.66.0",
Expand Down