Skip to main content

DeployPRO - NodeJS Sample

This free sample can be used to test the deployment for a simple NodeJS project.

👉 DeployPRO NodeJS Sample - source code


How to use it​

This NextJS sample is provided with Docker support, the only input expected by DeployPRO service.

FROM node:18-alpine
WORKDIR /home/node
USER node
COPY --chown=node:node ./package* ./
RUN npm install
COPY --chown=node:node ./ ./
ENV NODE_ENV=development

EXPOSE 5000
CMD [ "node", "server.js" ]

The above Dockerfile does the following:

  • Pull the Image for NodeJS, version 18
  • Install the dependencies
  • Update the ENVIRONMENT
  • Expose the port 5000
  • Starts the project

This setup can be tested in a local workstation by cloning the sources from GitHub and type:

$ docker-compose up --build

In order to have a succesfull deployment, DeployPRO needs to know:

  • the path to the Dockerfile
    • for this sample is ./Dockerfile
  • the external port
    • for this sample is 5000 (EXPOSE directive)

Once the above input is provided by the user, DeployPRO should operate the deployment without issues.


✅ Resources​

  • 👉 Deploy Projects using your preferred provider: AWS, DigitalOcean, Azure, and GCP (soon)
  • 👉 Get Deployment Support from the team behind this service
  • 👉 Join the Community and chat with the team behind DeployPRO