The repo for a sample nodejs / mongo / react app can be found here: https://github.com/getreploy/nodejs-mongo-sample
setup:commands:- cp seed.js /docker-entrypoint-initdb.d/services:frontend:runtime: reactjsport: 3000path: frontendbuild:- yarn install- yarn buildserve:- npx serve build/ -l 3000 -sbackend:runtime: nodejsport: 5000path: backendbuild:- npm installserve:- node app.jsmongo:image: mongoport: 27017do-not-expose: true
The reploy.yml
file for this environment can also be found here:
https://github.com/getreploy/nodejs-mongo-sample/blob/master/reploy.yml
In the above file, we have three services, each of which describe a "process" or "container". A little bit about each service:
The frontend
service is a react app, built with the create-react-app template. It uses our curated reactjs
runtime and uses the typical build commands packaged with yarn
.
The backend
service is a nodejs application, which uses our nodejs
runtime and uses npm for building the app.
Lastly, the mongo
service uses the public mongo
image and reads in the seed.js
file provided during the setup
routine so that the other services have access to staging data.