Initial Commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting Prisma migrations..."
|
||||
npx prisma migrate deploy
|
||||
echo "Prisma migrations completed."
|
||||
|
||||
sh replace-variables.sh &&
|
||||
|
||||
nginx &
|
||||
|
||||
echo "Starting the API server..."
|
||||
node packages/api/app.js &
|
||||
echo "API server started in the background."
|
||||
|
||||
echo "Starting the Dashboard..."
|
||||
cd packages/dashboard
|
||||
npx next start -p 5000 -H 0.0.0.0
|
||||
echo "Dashboard started."
|
||||
@@ -0,0 +1,25 @@
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 3000;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://plunk:4000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://plunk:5000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Baking Environment Variables..."
|
||||
|
||||
if [ -z "${API_URI}" ]; then
|
||||
echo "API_URI is not set. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find and replace baked values with real values for the API_URI
|
||||
find /app/packages/dashboard/public /app/packages/dashboard/.next -type f -name "*.js" |
|
||||
while read file; do
|
||||
sed -i "s|PLUNK_API_URI|${API_URI}|g" "$file"
|
||||
done
|
||||
|
||||
echo "Environment Variables Baked."
|
||||
Reference in New Issue
Block a user