Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +2 -2
- server.cjs +18 -0
Dockerfile
CHANGED
|
@@ -10,6 +10,6 @@ WORKDIR /app
|
|
| 10 |
COPY --from=build /app/dist ./dist
|
| 11 |
COPY --from=build /app/package*.json ./
|
| 12 |
RUN npm install --only=production
|
| 13 |
-
COPY server.
|
| 14 |
EXPOSE 7860
|
| 15 |
-
CMD ["node", "server.
|
|
|
|
| 10 |
COPY --from=build /app/dist ./dist
|
| 11 |
COPY --from=build /app/package*.json ./
|
| 12 |
RUN npm install --only=production
|
| 13 |
+
COPY server.cjs ./
|
| 14 |
EXPOSE 7860
|
| 15 |
+
CMD ["node", "server.cjs"]
|
server.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const path = require('path');
|
| 3 |
+
const app = express();
|
| 4 |
+
const port = 7860;
|
| 5 |
+
|
| 6 |
+
app.use(express.static(path.join(__dirname, 'dist')));
|
| 7 |
+
|
| 8 |
+
app.get('/health', (req, res) => {
|
| 9 |
+
res.status(200).send('OK');
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
app.get('*', (req, res) => {
|
| 13 |
+
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
|
| 14 |
+
});
|
| 15 |
+
|
| 16 |
+
app.listen(port, () => {
|
| 17 |
+
console.log(`Server running on port ${port}`);
|
| 18 |
+
});
|