Skip to content
A backend application built with node/express/mongodb deployed with docker to AWS Elastic Beanstalk
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ebextensions/nginx/conf.d
controllers
docker
models
routes
.dev.env
.dockerignore
.gitignore
.gitlab-ci.yml
README.md
database.js
docker-compose.yaml
error.js
gridfs.js
middleware.js
package.json
server.js
staging-backend-dockerrun.aws.json
wait-for-it.sh
yarn.lock

README.md

This is a backend application built with nodejs/express/mongodb. It is setup to run in AWS's Elastic Beanstalk.

Running the application for development

This application consists of two containers. MongoDB and a NodeJS application.

In order to run the application for development we will need to set env and build/run the application's containers.

Follow the below steps to run the application.

Application environment

The NodeJS application expects its enviroment to be specifed in a file named .env

The repo contains a .env.dev file, copy the contents of that file to .env and ensure that all env variables are set

Build the NodeJS container

To build the docker image of the backend run the following command in the root directory of the project:

docker build -f docker/Dockerfile -t path/ .

alternativly, you can run:

docker-compose build

The above command will build the containers that are specified in the docker-compose file

Run the application

Run the containers that are specifed in the docker-compose file:

docker-compose up

Alternative to steps 2 and 3

You can build and run in a single command:

docker-compose up --build

You can’t perform that action at this time.