# Dockerfile with 'projects' deployment

**URL:** <https://discourse.nodered.org/t/dockerfile-with-projects-deployment/43938>\
**Category:** General\
**Created:** [9 April 2021 20:19 UTC](https://discourse.nodered.org/t/dockerfile-with-projects-deployment/43938 "2021-04-09T20:19:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![supercross99](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/supercross99/32/31873_2.png) [@supercross99](https://discourse.nodered.org/u/supercross99)\
**Post date:** [9 April 2021 20:19 UTC](https://discourse.nodered.org/t/dockerfile-with-projects-deployment/43938/1 "2021-04-09T20:19:45Z")

</div>

I'm trying to build a custom NR docker image that does a few things:

1. Begins with nodered/node-red base image
2. Clones a git repo that has my flows and packages (preferrably to /data/projects/myproject)
3. Installs packages (npm install)
4. Point application to run from my custom project directory instead of the default /data/flows.json

I really like the 'Projects' feature and would like to have my custom image run from the project of my choice.  
I have steps 1-3 working but am not sure how to manipulate the files in order to launch the custom project?

I've enabled the projects feature in my docker-compose.yml file (NODE\_RED\_ENABLE\_PROJECTS=true) but I have to manually go into the editor and select my 'project' manually.  
Can I define this ahead of time in the Dockerfile?

Dockerfile so far:

```auto
FROM nodered/node-red

#Create projects directory
RUN mkdir /data/projects

#Clone the most up to date version of the code
WORKDIR /data/projects
RUN git clone https://token@gitsite.com/myCustomProject
WORKDIR /data/projects/myCustomProject

# Copy in the Root CA to avoid SSL errors
COPY ./ca-bundle.crt /usr/local/share/ca-certificates/ca-bundle.crt
RUN update-ca-certificates

# Copy package.json to the WORKDIR so npm builds all
# of your added nodes modules for Node-RED
#COPY package.json .
RUN npm config set strict-ssl false
RUN npm install 
#--unsafe-perm --no-update-notifier --no-fund --only=production

#make node red run from the /data/projects/myCustomProject directory??

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 June 2021 20:20 UTC](https://discourse.nodered.org/t/dockerfile-with-projects-deployment/43938/2 "2021-06-08T20:20:36Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
