sergeyyarkov / node-docker-example

This app showcases a website built with NodeJS. The site has a set of articles, each article has a separate page, all data about the article is stored in the PostgreSQL database. Docker is used to deploy the application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-docker-example

About

This app showcases a website built with NodeJS. The site has a set of articles, each article has a separate page, all data about the article is stored in the PostgreSQL database. Docker is used to deploy the application.

πŸ”— Deployed on Render

Folder structure

.
└── .
    β”œβ”€β”€ controllers - contains handlers for http requests
    β”œβ”€β”€ helpers - some string, file and database helper functions
    β”œβ”€β”€ middlewares - contains functions that will execute before the handler is executed
    β”œβ”€β”€ models - contains entities for their creation or getting
    β”œβ”€β”€ nginx - nginx web server config or certificate will place here
    β”œβ”€β”€ preloads - every file in this folder will be executed before starting the server
    β”œβ”€β”€ public - contains static files for http response
    β”œβ”€β”€ scripts - some bash scripts
    β”œβ”€β”€ sql - database ".sql" files for querying
    └── views - file for page rendering

How to deploy

  1. Clone this repository git clone https://github.com/sergeyyarkov/node-docker-example.git .
  2. Configure enviroment variables in docker-compose.yml for postgres and nodejs serivces if you need to
  3. Build and run application with docker-compose up --build

Requirements

  • Node.js >= v14.13.0
  • Docker

About

This app showcases a website built with NodeJS. The site has a set of articles, each article has a separate page, all data about the article is stored in the PostgreSQL database. Docker is used to deploy the application.

License:MIT License


Languages

Language:JavaScript 61.5%Language:Handlebars 16.0%Language:Shell 15.3%Language:CSS 5.4%Language:Dockerfile 1.8%