File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -32,20 +32,21 @@ service google-fluentd restart &
3232apt-get update
3333apt-get install -yq ca-certificates git build-essential supervisor
3434
35+
36+ # Fetch source code
37+ export HOME=/root
38+ git clone https://github.com/GoogleCloudPlatform/nodejs-getting-started.git /opt/app
39+
3540# Install nodejs
3641mkdir /opt/nodejs
37- curl https://nodejs.org/dist/v16.15 .0/node-v16.15 .0-linux-x64.tar.gz | tar xvzf - -C /opt/nodejs --strip-components=1
42+ curl https://nodejs.org/dist/v22.14 .0/node-v22.14 .0-linux-x64.tar.xz | tar xvfJ - -C /opt/nodejs --strip-components=1
3843ln -s /opt/nodejs/bin/node /usr/bin/node
3944ln -s /opt/nodejs/bin/npm /usr/bin/npm
4045
41- # Get the application source code from the Google Cloud Repository.
42- # git requires $HOME and it's not set during the startup script.
4346export HOME=/root
44- git config --global credential.helper gcloud.sh
45- git clone https://source.developers.google.com/p/${PROJECTID} /r/${REPOSITORY} /opt/app/new-repo
4647
4748# Install app dependencies
48- cd /opt/app/new-repo
49+ cd /opt/app/gce
4950npm install
5051
5152# Create a nodeapp user. The application will run as this user.
@@ -55,7 +56,7 @@ chown -R nodeapp:nodeapp /opt/app
5556# Configure supervisor to run the node app.
5657cat > /etc/supervisor/conf.d/node-app.conf << EOF
5758[program:nodeapp]
58- directory=/opt/app/new-repo
59+ directory=/opt/app/gce
5960command=npm start
6061autostart=true
6162autorestart=true
You can’t perform that action at this time.
0 commit comments