How to deploy Next.js/Node.js app on same self hosted runner

Swapnil Soni
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Hi there I'm using the following script to deploy

 

```yml

 

image:
node:20

pipelines:
branches:
main:
- step:
name: Build & Deploy
runs-on:
- self.hosted
- marvis.client.b2b.prod

services:
- docker
script:
- echo "Starting build and deploy"
- npm install --legacy-peer-deps
- npm run build
- npm run start
```

I sense the problem here, it's inside the docker container. any way I can just run it over pm2 on my host machine rather than inside docker. I'm kinda new to this so please guide. Thanks.

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2025

G'day, @Swapnil Soni 

Welcome to the community!

If I understand this correctly you wanted to deploy your Node.js app using Bitbucket runner to the hosted runner machine? If yes, I believe this is not possible for docker runner as mention in our documentations here

Can’t access the local files on the runner host from a build script: In order to provide isolation and reproducibility, a runner doesn’t provide access directly to the host file system, we recommend using SCP / Rsync, if necessary.

As mention above, the only way around this is to use SCP or Rsync to deploy them locally. Feel free to check out the following similar discussion if you wanted to deploy locally via SCP.

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events