AUXteam commited on
Commit
96cfefa
·
verified ·
1 Parent(s): 17b60d4

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -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.js ./
14
  EXPOSE 7860
15
- CMD ["node", "server.js"]
 
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
+ });