Skip to content

Commit 5451c98

Browse files
authored
fix: docker setup (#142)
1 parent fd1046e commit 5451c98

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
id: docker_build
6969
uses: docker/build-push-action@v6
7070
with:
71-
context: packages/fastify-app
7271
push: true
7372
tags: supabase/stripe-sync-engine:latest,supabase/stripe-sync-engine:v${{ needs.release.outputs.new-release-version }}
7473
platforms: linux/amd64,linux/arm64

packages/fastify-app/Dockerfile renamed to Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ FROM node:22-alpine
44
RUN npm install -g [email protected]
55

66
WORKDIR /app
7-
COPY package.json pnpm-lock.yaml ./
7+
COPY . ./
88
RUN pnpm install --frozen-lockfile
9-
COPY . /app
109
RUN pnpm build
1110
RUN pnpm prune --production
1211

@@ -15,4 +14,4 @@ FROM node:22-alpine
1514
WORKDIR /app
1615
ENV NODE_ENV=production
1716
COPY --from=0 /app .
18-
CMD ["npm", "start"]
17+
CMD ["node", "packages/fastify-app/dist/src/server.js"]

packages/fastify-app/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DATABASE_URL=postgres://postgres:postgres@host:5432/postgres?sslmode=disable&search_path=stripe
1+
DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable&search_path=stripe
22
STRIPE_WEBHOOK_SECRET=whsec_
33

44
# API_KEY is used to authenticate "admin" endpoints (i.e. for backfilling), make sure to generate a secure string

packages/fastify-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "@supabase/stripe-sync-fastify",
33
"version": "0.0.0",
44
"description": "Stripe sync engine. Sync your Stripe account to your Postgres database.",
5-
"main": "index.js",
5+
"main": "src/server.ts",
66
"scripts": {
77
"clean": "rimraf dist",
88
"dev": "tsx --watch ./src/server.ts",
99
"build": "pnpm clean && tsc -p tsconfig.json",
1010
"typecheck": "tsc -p tsconfig.json --noEmit",
1111
"lint": "eslint src --ext .ts",
12-
"start": "NODE_ENV=production node dist/server.js",
12+
"start": "NODE_ENV=production node dist/src/server.js",
1313
"test": "vitest"
1414
},
1515
"author": "Supabase",

packages/fastify-app/src/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import path from 'node:path'
66
import { getConfig } from './utils/config'
77
import { StripeSync } from '@supabase/stripe-sync-engine'
88
import { errorSchema } from './error'
9+
import { logger } from './logger'
910

1011
interface buildOpts extends FastifyServerOptions {
1112
exposeDocs?: boolean
@@ -15,7 +16,7 @@ export async function createServer(opts: buildOpts = {}): Promise<FastifyInstanc
1516
const app = fastify(opts)
1617

1718
const config = getConfig()
18-
const stripeSync = new StripeSync(config)
19+
const stripeSync = new StripeSync({ ...config, logger })
1920

2021
app.decorate('stripeSync', stripeSync)
2122

packages/fastify-app/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
5+
"module": "commonjs",
56
"outDir": "dist",
67
"declaration": true,
78
"declarationMap": true,

tsconfig.base.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
"skipLibCheck": true,
1414
"incremental": true
1515
},
16-
"exclude": ["node_modules", "dist"],
17-
"references": [{ "path": "./packages/sync-engine" }, { "path": "./packages/fastify-app" }]
16+
"exclude": ["node_modules", "dist"]
1817
}

0 commit comments

Comments
 (0)