File size: 755 Bytes
b05b936
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
# Use Node.js alpine image for a lightweight container
FROM node:20-alpine

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json first to leverage Docker's cache
COPY package*.json ./

# Install all dependencies (we need devDependencies as well since we build and use 'tsx' to run)
RUN npm install

# Copy the rest of the application source code
COPY . .

# Build the client-side Vite application (creates the /app/dist folder)
RUN npm run build

# Set environment to production
ENV NODE_ENV=production

# Hugging Face Spaces defaults to exposing port 7860.
# The container must listen on port 7860.
ENV PORT=7860
EXPOSE 7860

# Start the full-stack server using our node/tsx setup
CMD ["npm", "start"]