Spaces:
Sleeping
Sleeping
Commit ·
4d85a76
1
Parent(s): 944af38
add .gitignore and Dockerfile for project setup
Browse files- .gitignore +3 -0
- Dockerfile +25 -0
.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules/
|
| 2 |
+
data/results.json
|
| 3 |
+
.DS_Store
|
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-alpine
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install dependencies first (cached layer)
|
| 6 |
+
COPY package.json ./
|
| 7 |
+
RUN npm install --omit=dev
|
| 8 |
+
|
| 9 |
+
# Copy app files
|
| 10 |
+
COPY server.js ./
|
| 11 |
+
COPY public/ ./public/
|
| 12 |
+
COPY images/ ./images/
|
| 13 |
+
|
| 14 |
+
# HF Spaces requires port 7860
|
| 15 |
+
ENV PORT=7860
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
|
| 18 |
+
# Run as non-root (HF Spaces requirement)
|
| 19 |
+
RUN addgroup -S appgroup && adduser -S appuser -G appgroup \
|
| 20 |
+
&& mkdir -p data \
|
| 21 |
+
&& chown -R appuser:appgroup /app
|
| 22 |
+
|
| 23 |
+
USER appuser
|
| 24 |
+
|
| 25 |
+
CMD ["node", "server.js"]
|