Refactor image upload handling by moving upload directory outside of public folder for better compatibility with Next.js. Update related Docker configurations and scripts to reflect new upload paths. Replace instances of Next.js Image component with CmsImage for consistent image handling across the application.

This commit is contained in:
smhk1376 committed 2026-10-22 12:51:18 +03:30
1 parent 0a57ef2b80
commit 1641edfd01
19 files changed
+162 -39

No files matched your search

+4 -4
View File
@@ -44,8 +44,8 @@ docker run --rm --network "$NETWORK" --env-file "$ENV_FILE" \
# Check the database and a minimal page set before switching the public upstream.
CANDIDATE="edu-candidate-${REVISION:0:12}"
docker run -d --name "$CANDIDATE" --network "$NETWORK" --env-file "$ENV_FILE" \
-e UPLOAD_DIR=/app/public/uploads \
-v "$UPLOAD_VOLUME:/app/public/uploads" \
-e UPLOAD_DIR=/app/uploads \
-v "$UPLOAD_VOLUME:/app/uploads" \
"$IMAGE"
cleanup_candidate() { docker rm -f "$CANDIDATE" >/dev/null 2>&1 || true; }
trap cleanup_candidate EXIT
@@ -101,8 +101,8 @@ rollback() {
trap rollback ERR
docker run -d --name "$CONTAINER" --restart unless-stopped \
--network "$NETWORK" --env-file "$ENV_FILE" \
-e UPLOAD_DIR=/app/public/uploads \
-v "$UPLOAD_VOLUME:/app/public/uploads" \
-e UPLOAD_DIR=/app/uploads \
-v "$UPLOAD_VOLUME:/app/uploads" \
-p 127.0.0.1:3000:3000 "$IMAGE"
READY=false
for attempt in $(seq 1 20); do
+3 -5
View File
@@ -149,17 +149,15 @@ async function main() {
}
const sequences = await client.query(`
SELECT sequencename, last_value, is_called
SELECT sequencename, last_value
FROM pg_sequences
WHERE schemaname = 'public'
ORDER BY sequencename
`);
for (const seq of sequences.rows) {
const called = seq.is_called === true;
if (seq.last_value == null) continue;
const seqName = String(seq.sequencename).replaceAll("'", "''");
lines.push(
`SELECT setval('${seqName}', ${Number(seq.last_value)}, ${called});`,
);
lines.push(`SELECT setval('${seqName}', ${Number(seq.last_value)}, true);`);
}
lines.push("", "COMMIT;", "");