diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a5b9da35..c6371ae7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,6 @@ jobs: id: docker_build uses: docker/build-push-action@v6 with: - context: packages/fastify-app push: true tags: supabase/stripe-sync-engine:latest,supabase/stripe-sync-engine:v${{ needs.release.outputs.new-release-version }} platforms: linux/amd64,linux/arm64 diff --git a/packages/fastify-app/Dockerfile b/Dockerfile similarity index 80% rename from packages/fastify-app/Dockerfile rename to Dockerfile index 66c268a47..0761705cb 100644 --- a/packages/fastify-app/Dockerfile +++ b/Dockerfile @@ -4,9 +4,8 @@ FROM node:22-alpine RUN npm install -g pnpm@10.10.0 WORKDIR /app -COPY package.json pnpm-lock.yaml ./ +COPY . ./ RUN pnpm install --frozen-lockfile -COPY . /app RUN pnpm build RUN pnpm prune --production @@ -15,4 +14,4 @@ FROM node:22-alpine WORKDIR /app ENV NODE_ENV=production COPY --from=0 /app . -CMD ["npm", "start"] \ No newline at end of file +CMD ["node", "packages/fastify-app/dist/src/server.js"] \ No newline at end of file diff --git a/packages/fastify-app/.env.sample b/packages/fastify-app/.env.sample index 056c79735..c971d7dde 100644 --- a/packages/fastify-app/.env.sample +++ b/packages/fastify-app/.env.sample @@ -1,4 +1,4 @@ -DATABASE_URL=postgres://postgres:postgres@host:5432/postgres?sslmode=disable&search_path=stripe +DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable&search_path=stripe STRIPE_WEBHOOK_SECRET=whsec_ # API_KEY is used to authenticate "admin" endpoints (i.e. for backfilling), make sure to generate a secure string diff --git a/packages/fastify-app/package.json b/packages/fastify-app/package.json index edb534af1..7f57e56f5 100644 --- a/packages/fastify-app/package.json +++ b/packages/fastify-app/package.json @@ -2,14 +2,14 @@ "name": "@supabase/stripe-sync-fastify", "version": "0.0.0", "description": "Stripe sync engine. Sync your Stripe account to your Postgres database.", - "main": "index.js", + "main": "src/server.ts", "scripts": { "clean": "rimraf dist", "dev": "tsx --watch ./src/server.ts", "build": "pnpm clean && tsc -p tsconfig.json", "typecheck": "tsc -p tsconfig.json --noEmit", "lint": "eslint src --ext .ts", - "start": "NODE_ENV=production node dist/server.js", + "start": "NODE_ENV=production node dist/src/server.js", "test": "vitest" }, "author": "Supabase", diff --git a/packages/fastify-app/src/app.ts b/packages/fastify-app/src/app.ts index c0e93ebfe..b6a4d29ae 100644 --- a/packages/fastify-app/src/app.ts +++ b/packages/fastify-app/src/app.ts @@ -6,6 +6,7 @@ import path from 'node:path' import { getConfig } from './utils/config' import { StripeSync } from '@supabase/stripe-sync-engine' import { errorSchema } from './error' +import { logger } from './logger' interface buildOpts extends FastifyServerOptions { exposeDocs?: boolean @@ -15,7 +16,7 @@ export async function createServer(opts: buildOpts = {}): Promise