Skip to content

Commit abfee30

Browse files
authored
fix: deployment (#126)
1 parent 637c193 commit abfee30

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

apps/api/src/lib/env.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { standardValidate } from "@hoalu/common/standard-validate";
22
import { type } from "arktype";
33

44
export const envSchema = type({
5-
AUTH_SECRET: "string",
5+
AUTH_SECRET: "string > 0",
66
AUTH_URL: "string.url",
77
DB_HOST: "string > 0",
88
DB_NAME: "string > 0",
@@ -18,6 +18,7 @@ export const envSchema = type({
1818
S3_SECRET_KEY: "string > 0",
1919
S3_BUCKET: "string > 0",
2020
S3_ENDPOINT: "string > 0",
21+
SYNC_SECRET: "string > 0",
2122
SYNC_URL: "string.url",
2223
});
2324

apps/api/src/modules/sync.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function syncModule() {
3030
searchParams.forEach((value, key) => {
3131
shapeUrl.searchParams.set(key, value);
3232
});
33+
// ELECTRIC_SECRET
34+
shapeUrl.searchParams.set("api_secret", process.env.SYNC_SECRET);
3335

3436
const electricResponse = await fetch(shapeUrl.toString());
3537

deployments/docker-compose.local.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ services:
2727
environment:
2828
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@database:5432/${DB_NAME}?sslmode=disable
2929
- ELECTRIC_PORT=4000
30+
- ELECTRIC_SECRET=${SYNC_SECRET}
3031
ports:
3132
- 4000:4000
3233
depends_on:

deployments/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ services:
3636
environment:
3737
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME}?sslmode=disable
3838
- ELECTRIC_PORT=4000
39+
- ELECTRIC_SECRET=${SYNC_SECRET}
3940
depends_on:
4041
- database
4142
volumes:

deployments/migration.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM oven/bun:1.2.5-alpine
22
WORKDIR /migrations
33

4-
RUN bun install drizzle-orm drizzle-kit postgres
4+
RUN bun install drizzle-orm drizzle-kit pg
55
COPY ./apps/api/drizzle.config.ts .
66
COPY ./apps/api/src/db/schema.ts ./src/db/schema.ts
77
COPY ./apps/api/migrations ./migrations

0 commit comments

Comments
 (0)