Skip to content

Commit 32d7d46

Browse files
committed
fix(docker): revert prerender and add configurable secrets
- Remove prerender=true from public pages (caused build failure) - Add SECRETS_FILE build arg to Dockerfile - Add docker-build.sh script for local builds - Remove secrets.dev.yaml from .dockerignore
1 parent 44cc902 commit 32d7d46

File tree

11 files changed

+18
-11
lines changed

11 files changed

+18
-11
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ build
77
.env.*
88
!.env.sample
99
.sops-age-key.txt
10-
secrets.dev.yaml
1110
*.db
1211
.git

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ run `bun tidy` after you finish your work. i.e. before commit
132132
```
133133

134134
For detailed coding standards (import order, async patterns, naming conventions), see `docs/knowledges/coding-standards.md`.
135+
136+
# Requirements
137+
138+
do NOT read sops secrets. do NOT read .env.

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ RUN bun run prepare
2222

2323
# Build with sops secrets
2424
ARG SOPS_AGE_KEY
25+
ARG SECRETS_FILE=secrets.prod.yaml
2526
ENV SOPS_AGE_KEY=${SOPS_AGE_KEY}
26-
RUN sops exec-env secrets.prod.yaml 'bun run build'
27+
RUN sops exec-env ${SECRETS_FILE} 'bun run build'
2728

2829
FROM base AS executor
2930
WORKDIR /app
31+
ARG SECRETS_FILE=secrets.prod.yaml
3032

3133
# Copy built application
3234
COPY --from=builder /app/build ./build
3335
COPY --from=builder /app/package.json ./
34-
COPY secrets.prod.yaml ./secrets.yaml
36+
COPY ${SECRETS_FILE} ./secrets.yaml
3537

3638
# Copy drizzle migration files and config
3739
COPY --from=builder /app/drizzle ./drizzle

scripts/docker-build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SECRETS_FILE="${1:-secrets.dev.yaml}"
5+
6+
SOPS_AGE_KEY=$(cat .sops-age-key.txt)
7+
docker build \
8+
--build-arg SOPS_AGE_KEY="$SOPS_AGE_KEY" \
9+
--build-arg SECRETS_FILE="$SECRETS_FILE" \
10+
.

src/routes/(site)/+page.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ export const load: PageServerLoad = async () => {
1313
allProjects,
1414
};
1515
};
16-
17-
export const prerender = true;

src/routes/(site)/about/+page.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/routes/(site)/about/faq/+page.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/routes/(site)/activities/+page.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/routes/(site)/donation/+page.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/routes/(site)/join/+page.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)