File size: 710 Bytes
084aac3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use an official Node.js runtime as the base image
FROM node:20

# Set the working directory in the container
WORKDIR /app

# Copy package.json and install all dependencies
COPY package.json ./
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the React frontend into the 'dist' folder
# This is the folder server.js will serve
RUN npm run build

# Create an empty SQLite database file and set permissions
# This ensures the application has write access in the container
RUN touch database.db && chmod 777 database.db

# Hugging Face Spaces use port 7860 by default
ENV PORT=7860
EXPOSE 7860

# Start the application using the start script defined in package.json
CMD ["npm", "start"]