vimalk78 commited on
Commit
44d22f1
·
1 Parent(s): 88452f7

prepared for hf deployment

Browse files

Signed-off-by: Vimal Kumar <[email protected]>

Files changed (2) hide show
  1. Dockerfile +36 -0
  2. README.md +12 -2
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Node.js 18 as base image
2
+ FROM node:18-alpine
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy package files for both frontend and backend
8
+ COPY crossword-app/frontend/package*.json ./frontend/
9
+ COPY crossword-app/backend/package*.json ./backend/
10
+
11
+ # Install dependencies for both frontend and backend
12
+ RUN cd frontend && npm ci
13
+ RUN cd backend && npm ci --only=production
14
+
15
+ # Copy source code
16
+ COPY crossword-app/frontend/ ./frontend/
17
+ COPY crossword-app/backend/ ./backend/
18
+
19
+ # Build the React frontend
20
+ RUN cd frontend && npm run build
21
+
22
+ # Copy built frontend files to backend public directory
23
+ RUN mkdir -p backend/public && cp -r frontend/dist/* backend/public/
24
+
25
+ # Set working directory to backend for runtime
26
+ WORKDIR /app/backend
27
+
28
+ # Expose port 7860 (Hugging Face Spaces standard)
29
+ EXPOSE 7860
30
+
31
+ # Set environment to production
32
+ ENV NODE_ENV=production
33
+ ENV PORT=7860
34
+
35
+ # Start the backend server
36
+ CMD ["npm", "start"]
README.md CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  # Crossword Puzzle Generator
2
 
3
  A full-stack web application for generating and solving crossword puzzles with various topics.
@@ -59,14 +69,14 @@ A full-stack web application for generating and solving crossword puzzles with v
59
 
60
  **Build and run with Docker:**
61
  ```bash
62
- cd crossword-app
63
  docker build -t crossword-app .
64
  docker run -p 7860:7860 -e NODE_ENV=production crossword-app
65
  ```
66
 
67
  Open `http://localhost:7860` to access the application.
68
 
69
- **For Hugging Face Spaces:** Upload the `crossword-app/` directory to a new Docker Space.
70
 
71
  ## How to Use
72
 
 
1
+ ---
2
+ title: Crossword Puzzle Generator
3
+ emoji: 🧩
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ ---
10
+
11
  # Crossword Puzzle Generator
12
 
13
  A full-stack web application for generating and solving crossword puzzles with various topics.
 
69
 
70
  **Build and run with Docker:**
71
  ```bash
72
+ # From project root
73
  docker build -t crossword-app .
74
  docker run -p 7860:7860 -e NODE_ENV=production crossword-app
75
  ```
76
 
77
  Open `http://localhost:7860` to access the application.
78
 
79
+ **For Hugging Face Spaces:** This repository is ready for Docker-based deployment.
80
 
81
  ## How to Use
82