-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.dev.sh
More file actions
37 lines (28 loc) · 1.09 KB
/
entrypoint.dev.sh
File metadata and controls
37 lines (28 loc) · 1.09 KB
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
30
31
32
33
34
35
36
37
#!/bin/bash
set -euo pipefail
echo "Starting MicroBook Maker in development mode with hot reload..."
# Make this script executable (in case it wasn't already)
chmod +x /app/entrypoint.dev.sh
fc-cache -fv
# Install frontend dependencies
cd /app/fe
echo -e "\n\e[34mInstalling Frontend dependencies...\e[0m"
npm install
# Install backend dependencies
cd /app/be
echo -e "\n\e[34mInstalling Backend dependencies...\e[0m"
npm install
# Start backend with PM2 in watch mode for hot reload
echo -e "\n\e[34mStarting backend with hot reload...\e[0m"
pm2 start /app/be/index.js --name backend --watch --ignore-watch="node_modules generated uploads output.html *.pdf"
# Start frontend dev server with hot reload
echo -e "\n\e[34mStarting frontend dev server with hot reload...\e[0m"
cd /app/fe
pm2 start "npm run dev" --name frontend
# Start nginx with development config (proxies to Vite dev server)
echo -e "\n\e[34mStarting nginx with development config...\e[0m"
# Copy nginx config from mount to nginx config location
cp /app/nginx.dev.conf /etc/nginx/nginx.conf
nginx
# Show logs from all services
pm2 logs