File size: 596 Bytes
de234b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/sh
set -e

# Check the STAGE environment variable
if [ "$STAGE" = "backend" ]; then

    # Update and install dependencies
    apt-get update && apt-get install -y --no-install-recommends gcc g++

    # Install python dependencies
    pip install --no-cache-dir -r requirements.txt

elif [ "$STAGE" = "frontend" ]; then

    # Install dependencies
    npm install

    # Adjust permissions and build in a single command
    chown -R node:node /app/frontend
    npm run build

    # Install serve
    npm install -g serve

else
    echo "Error: Invalid or no STAGE specified"
    exit 1
fi