Spaces:
Sleeping
Sleeping
Commit
·
8b1d20d
1
Parent(s):
f99c2c7
chore: create directories for generated images and set permissions in Dockerfile; update start.sh to run frontend and backend as nextjs user
Browse files- Dockerfile +5 -0
- start.sh +4 -2
Dockerfile
CHANGED
@@ -46,6 +46,11 @@ COPY --from=frontend-builder --chown=nextjs:nodejs /app/.next/cache ./frontend/.
|
|
46 |
COPY --from=backend /backend ./backend
|
47 |
COPY --from=backend /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
48 |
|
|
|
|
|
|
|
|
|
|
|
49 |
COPY start.sh .
|
50 |
RUN chmod +x start.sh
|
51 |
|
|
|
46 |
COPY --from=backend /backend ./backend
|
47 |
COPY --from=backend /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
48 |
|
49 |
+
# Create directories and set permissions
|
50 |
+
RUN mkdir -p /app/generated_images && \
|
51 |
+
chown -R nextjs:nodejs /app/backend /app/generated_images && \
|
52 |
+
chmod -R 755 /app/backend /app/generated_images
|
53 |
+
|
54 |
COPY start.sh .
|
55 |
RUN chmod +x start.sh
|
56 |
|
start.sh
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
#!/bin/sh
|
2 |
-
|
3 |
-
|
|
|
|
|
|
1 |
#!/bin/sh
|
2 |
+
# Start frontend as nextjs user
|
3 |
+
su nextjs -c "node frontend/server.js" &
|
4 |
+
# Start backend as nextjs user
|
5 |
+
su nextjs -c "python -m uvicorn backend.app.main:app --host 0.0.0.0 --port 8000"
|