Skip to content

Commit

Permalink
launch nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
pitiscarf committed Feb 21, 2025
1 parent ca8b514 commit 4751847
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
8 changes: 4 additions & 4 deletions devops/admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ if [[ $CC_DEPLOYMENT_ID != "" ]]; then
# NODEJS nginx
# CC_NODE_BUILD_TOOL=custom
# CC_CUSTOM_BUILD_TOOL="VITE_RELEASE=$CC_COMMIT_ID devops/admin/build.sh"
# CC_RUN_COMMAND="nginx -g 'daemon off;' -c nginx.conf"
mv devops/admin/nginx.conf devops/admin/index.js devops/admin/package.json .
rm -rf $(ls -A | grep -v "build\|nginx.conf\|index.js\|package.json")
npm install
# CC_RUN_COMMAND="nginx -c $APP_HOME/nginx.conf"
mv devops/admin/package.json .
envsubst < devops/admin/nginx.conf > nginx.conf
rm -rf $(ls -A | grep -v "build\|nginx.conf\|package.json")
fi

ls -la
23 changes: 17 additions & 6 deletions devops/admin/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
server {
listen 8080 default_server;
daemon off;
error_log stderr;
pid $APP_HOME/nginx.pid;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri /index.html;
events {
worker_connections 1024;
}

http {
access_log off;
server {
listen $PORT default_server;

location / {
root $APP_HOME/build;
index index.html;
try_files $uri /index.html;
}
}
}
2 changes: 1 addition & 1 deletion devops/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"node": "^20.17"
},
"scripts": {
"nginx-start": "nginx -g 'daemon off;' -c nginx.conf"
"start": "nginx -c $APP_HOME/nginx.conf"
},
"author": "",
"license": "ISC",
Expand Down

0 comments on commit 4751847

Please sign in to comment.