gaialive commited on
Commit
3cb2ade
·
verified ·
1 Parent(s): 4aaf0d7

Upload 5 files

Browse files
Files changed (2) hide show
  1. Dockerfile +29 -3
  2. huggingface.yml +2 -1
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Multi-stage build for frontend
2
  FROM node:18-alpine as frontend-build
3
 
4
  # Set the working directory
@@ -11,7 +11,7 @@ COPY frontend/ ./
11
  RUN npm run build
12
 
13
  # Backend build
14
- FROM node:18-alpine as backend-build
15
  WORKDIR /app
16
  COPY backend/package*.json ./
17
  RUN npm install
@@ -37,4 +37,30 @@ COPY --from=backend-build /app ./
37
  EXPOSE 80 3000
38
 
39
  # Start both services
40
- CMD nginx && npm start
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #Multi-stage build for frontend
2
  FROM node:18-alpine as frontend-build
3
 
4
  # Set the working directory
 
11
  RUN npm run build
12
 
13
  # Backend build
14
+ FROM node:18-alpineas backend-build
15
  WORKDIR /app
16
  COPY backend/package*.json ./
17
  RUN npm install
 
37
  EXPOSE 80 3000
38
 
39
  # Start both services
40
+ CMD nginx && npm start
41
+
42
+ # Useasingle Node.js base image
43
+ FROM node:18-bullseye
44
+
45
+ # Create app directory
46
+ WORKDIR /app
47
+
48
+ # Copy package files
49
+ COPY frontend/package*.json ./frontend/
50
+ COPY backend/package*.json ./backend/
51
+
52
+ # Install dependencies for both frontend and backend
53
+ RUN cd frontend && npm install
54
+ RUN cdbackend && npm install
55
+
56
+ # Copy the rest of the application code
57
+ COPY . .
58
+
59
+ # Make the startup script executable
60
+ RUN chmod +x start.sh
61
+
62
+ # Expose ports for both frontend and backend
63
+ EXPOSE 5173 3000
64
+
65
+ # Start both services
66
+ CMD ["./start.sh"]
huggingface.yml CHANGED
@@ -1,3 +1,4 @@
1
  # Hugging Face Space configuration
2
  name: n4sm-platform
3
- sdk: docker
 
 
1
  # Hugging Face Space configuration
2
  name: n4sm-platform
3
+ sdk: docker
4
+ app_port: 5173