Skip to content

Commit 0e71d9d

Browse files
committed
implemented rabbit's recommendations
1 parent a0ad203 commit 0e71d9d

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ ENV PATH="/usr/local/bun/bin:$PATH"
7575
EXPOSE 3000
7676

7777
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
78-
CMD wget -qO- http://localhost:3000/health || exit 1
78+
CMD curl -sf http://localhost:3000/health || exit 1
7979

8080
CMD ["sh", "-c", "bun src/server.ts"]

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
ports:
88
- "3000:3000"
99
environment:
10-
NODE_ENV: production
10+
NODE_ENV: development
1111
PORT: 3000
1212
DATABASE_URL: "postgresql://postgres:example@db:5432/coc?sslmode=disable"
1313
volumes:
@@ -17,7 +17,7 @@ services:
1717
depends_on:
1818
- db
1919
healthcheck:
20-
test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
20+
test: ["CMD", "curl", "-sf", "http://localhost:3000/health"]
2121
interval: 30s
2222
timeout: 3s
2323
retries: 3

scripts/setup-local.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ DUMP_FILE="$SEED_DIR/dump.sql"
2525
SKIP_DUMP=false
2626
SKIP_SEED=false
2727

28+
if [[ "$OSTYPE" == "darwin"* ]]; then
29+
SED_INPLACE=(-i '')
30+
else
31+
SED_INPLACE=(-i)
32+
fi
33+
2834
# ---- Parse args ----
2935
for arg in "$@"; do
3036
case $arg in
@@ -148,22 +154,24 @@ else
148154
info "Stripping Supabase-only extensions from dump..."
149155
SUPABASE_EXTS="pg_graphql|pg_net|pgsodium|supabase_vault|wrappers|pg_stat_monitor|hypopg"
150156

151-
sed -i -E \
157+
sed "${SED_INPLACE[@]}" -E \
152158
"s#^(CREATE EXTENSION IF NOT EXISTS ($SUPABASE_EXTS).*)#-- [local] \1#g" \
153159
"$DUMP_FILE"
154-
sed -i -E \
160+
161+
sed "${SED_INPLACE[@]}" -E \
155162
"s#^(DROP EXTENSION IF EXISTS ($SUPABASE_EXTS).*)#-- [local] \1#g" \
156163
"$DUMP_FILE"
157164

165+
158166
# Strip COMMENT ON EXTENSION for stripped extensions
159-
sed -i -E \
167+
sed "${SED_INPLACE[@]}" -E \
160168
"s#^(COMMENT ON EXTENSION ($SUPABASE_EXTS) .*)#-- [local] \1#g" \
161169
"$DUMP_FILE"
162170
info "Supabase-only extension cleanup done."
163171

164172
# ---- Patch extension schema: 'extensions' -> 'public' ----
165173
info "Patching extension schema references (extensions -> public)..."
166-
sed -i -E \
174+
sed "${SED_INPLACE[@]}" -E \
167175
"s#WITH SCHEMA extensions#WITH SCHEMA public#g" \
168176
"$DUMP_FILE"
169177
info "Extension schema patch done."

0 commit comments

Comments
 (0)