Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +11 -7
Dockerfile
CHANGED
|
@@ -55,13 +55,17 @@ COPY --chown=user:user --from=frontend-builder /build/public ./frontend/public
|
|
| 55 |
COPY --chown=user:user --from=frontend-builder /build/package.json ./frontend/
|
| 56 |
COPY --chown=user:user --from=frontend-builder /build/node_modules ./frontend/node_modules
|
| 57 |
|
| 58 |
-
#
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
EXPOSE 7860
|
|
|
|
| 55 |
COPY --chown=user:user --from=frontend-builder /build/package.json ./frontend/
|
| 56 |
COPY --chown=user:user --from=frontend-builder /build/node_modules ./frontend/node_modules
|
| 57 |
|
| 58 |
+
# Sử dụng RUN để thực thi chuỗi lệnh bash an toàn
|
| 59 |
+
RUN printf '#!/bin/bash\n\
|
| 60 |
+
set -e\n\
|
| 61 |
+
echo "🚀 Starting AnyCoder..."\n\
|
| 62 |
+
uvicorn backend_api:app --host 0.0.0.0 --port 8000 --log-level debug &\n\
|
| 63 |
+
echo "⏳ Waiting for backend..."\n\
|
| 64 |
+
sleep 15\n\
|
| 65 |
+
echo "🎨 Starting Frontend on port 7860..."\n\
|
| 66 |
+
export PORT=7860\n\
|
| 67 |
+
export HOSTNAME="0.0.0.0"\n\
|
| 68 |
+
cd /home/user/app/frontend && node .next/standalone/server.js\n' > start.sh && chmod +x start.sh
|
| 69 |
|
| 70 |
|
| 71 |
EXPOSE 7860
|