Skip to content

fix: deployment #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 22, 2025
Merged
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
3 changes: 2 additions & 1 deletion apps/api/src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { standardValidate } from "@hoalu/common/standard-validate";
import { type } from "arktype";

export const envSchema = type({
AUTH_SECRET: "string",
AUTH_SECRET: "string > 0",
AUTH_URL: "string.url",
DB_HOST: "string > 0",
DB_NAME: "string > 0",
Expand All @@ -18,6 +18,7 @@ export const envSchema = type({
S3_SECRET_KEY: "string > 0",
S3_BUCKET: "string > 0",
S3_ENDPOINT: "string > 0",
SYNC_SECRET: "string > 0",
SYNC_URL: "string.url",
});

Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/modules/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export function syncModule() {
searchParams.forEach((value, key) => {
shapeUrl.searchParams.set(key, value);
});
// ELECTRIC_SECRET
shapeUrl.searchParams.set("api_secret", process.env.SYNC_SECRET);

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

Expand Down
1 change: 1 addition & 0 deletions deployments/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
environment:
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@database:5432/${DB_NAME}?sslmode=disable
- ELECTRIC_PORT=4000
- ELECTRIC_SECRET=${SYNC_SECRET}
ports:
- 4000:4000
depends_on:
Expand Down
1 change: 1 addition & 0 deletions deployments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
environment:
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME}?sslmode=disable
- ELECTRIC_PORT=4000
- ELECTRIC_SECRET=${SYNC_SECRET}
depends_on:
- database
volumes:
Expand Down
2 changes: 1 addition & 1 deletion deployments/migration.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM oven/bun:1.2.5-alpine
WORKDIR /migrations

RUN bun install drizzle-orm drizzle-kit postgres
RUN bun install drizzle-orm drizzle-kit pg
COPY ./apps/api/drizzle.config.ts .
COPY ./apps/api/src/db/schema.ts ./src/db/schema.ts
COPY ./apps/api/migrations ./migrations
Expand Down