gaialive commited on
Commit
d1521e3
·
verified ·
1 Parent(s): a515b6f

Upload 5 files

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -8
  2. startup.bat +7 -4
  3. startup.sh +7 -4
Dockerfile CHANGED
@@ -29,7 +29,7 @@ COPY server/package*.json ./
29
  RUN npm install --only=production
30
 
31
  # Copy server source
32
- COPY server/ ./
33
 
34
  # Production image
35
  FROM node:18-alpine
@@ -40,14 +40,14 @@ RUN apk add --no-cache nginx
40
  # Create app directory
41
  WORKDIR /app
42
 
43
- # Copy server build
44
- COPY --from=server-builder /app ./
45
 
46
  # Copy client build to nginx
47
  COPY --from=client-builder /app/dist /usr/share/nginx/html
48
 
49
  # Copy nginx configuration
50
- COPY client/nginx.conf /etc/nginx/nginx.conf
51
 
52
  # Copy startup script
53
  COPY startup.sh .
@@ -58,9 +58,5 @@ RUN chmod +x startup.sh
58
  # Expose ports
59
  EXPOSE 80 3001
60
 
61
- # Health check
62
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
63
- CMD curl -f http://localhost/health || exit 1
64
-
65
  # Start both nginx and node server
66
  CMD ["./startup.sh"]
 
29
  RUN npm install --only=production
30
 
31
  # Copy server source
32
+ COPY server/ ./server/
33
 
34
  # Production image
35
  FROM node:18-alpine
 
40
  # Create app directory
41
  WORKDIR /app
42
 
43
+ # Copy server files
44
+ COPY --from=server-builder /app/server ./
45
 
46
  # Copy client build to nginx
47
  COPY --from=client-builder /app/dist /usr/share/nginx/html
48
 
49
  # Copy nginx configuration
50
+ COPY client/nginx.conf /etc/nginx/http.d/default.conf
51
 
52
  # Copy startup script
53
  COPY startup.sh .
 
58
  # Expose ports
59
  EXPOSE 80 3001
60
 
 
 
 
 
61
  # Start both nginx and node server
62
  CMD ["./startup.sh"]
startup.bat CHANGED
@@ -1,6 +1,9 @@
1
  @echo off
2
- REM Start nginx in the background
3
- start nginx
4
 
5
- REM Start the Node.js server
6
- node server/index.js
 
 
 
 
1
  @echo off
2
+ REM Start the Node.js server in the background
3
+ start node index.js
4
 
5
+ REM Give the server a moment to start
6
+ timeout /t 3 /nobreak >nul
7
+
8
+ REM Start nginx in the foreground
9
+ nginx -g "daemon off;"
startup.sh CHANGED
@@ -1,7 +1,10 @@
1
  #!/bin/sh
2
 
3
- # Start nginx in the background
4
- nginx &
5
 
6
- # Start the Node.js server
7
- node server/index.js
 
 
 
 
1
  #!/bin/sh
2
 
3
+ # Start the Node.js server in the background
4
+ node index.js &
5
 
6
+ # Give the server a moment to start
7
+ sleep 3
8
+
9
+ # Start nginx in the foreground
10
+ nginx -g "daemon off;"