Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update sh file
Browse files- Dockerfile +1 -1
- entrypoint.sh +0 -3
- src/routes/api/generate/+server.ts +2 -0
Dockerfile
CHANGED
@@ -20,7 +20,7 @@ RUN chmod +x entrypoint.sh
|
|
20 |
EXPOSE 3000
|
21 |
|
22 |
# Create symlink
|
23 |
-
|
24 |
|
25 |
# Start the application
|
26 |
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
|
|
|
20 |
EXPOSE 3000
|
21 |
|
22 |
# Create symlink
|
23 |
+
RUN mkdir -p ./static/data && ln -s /data/uploads ./static/data/uploads
|
24 |
|
25 |
# Start the application
|
26 |
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
|
entrypoint.sh
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
#!/bin/bash
|
2 |
npx prisma generate &&
|
3 |
npm run build &&
|
4 |
-
# Create symlink from /data/uploads to /static/data/uploads
|
5 |
-
mkdir -p ./static/data &&
|
6 |
-
ln -s /data/uploads ./static/data/uploads &&
|
7 |
npx prisma generate &&
|
8 |
npx prisma migrate deploy &&
|
9 |
npx prisma db push &&
|
|
|
1 |
#!/bin/bash
|
2 |
npx prisma generate &&
|
3 |
npm run build &&
|
|
|
|
|
|
|
4 |
npx prisma generate &&
|
5 |
npx prisma migrate deploy &&
|
6 |
npx prisma db push &&
|
src/routes/api/generate/+server.ts
CHANGED
@@ -81,6 +81,8 @@ export async function POST({ request, cookies } : RequestEvent) {
|
|
81 |
}
|
82 |
const file_name_formatted = randomUUID() + "_" + generation?.inputs?.replaceAll(/[^a-zA-Z0-9]/g, "-") + ".png"
|
83 |
await promises.writeFile(`${publicEnv.PUBLIC_FILE_UPLOAD_DIR}/${file_name_formatted}`, response)
|
|
|
|
|
84 |
|
85 |
gallery = await prisma.gallery.create({
|
86 |
data: {
|
|
|
81 |
}
|
82 |
const file_name_formatted = randomUUID() + "_" + generation?.inputs?.replaceAll(/[^a-zA-Z0-9]/g, "-") + ".png"
|
83 |
await promises.writeFile(`${publicEnv.PUBLIC_FILE_UPLOAD_DIR}/${file_name_formatted}`, response)
|
84 |
+
// create symlink
|
85 |
+
await promises.symlink(`${publicEnv.PUBLIC_FILE_UPLOAD_DIR}/${file_name_formatted}`, `./static/${publicEnv.PUBLIC_FILE_UPLOAD_DIR}/${file_name_formatted}`, "file")
|
86 |
|
87 |
gallery = await prisma.gallery.create({
|
88 |
data: {
|