diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c4b2ae2 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +PORT=4000 +PG_HOST= +PG_PORT= +PG_USER= +PG_PASSWORD= +PG_DB_NAME= \ No newline at end of file diff --git a/README.md b/README.md index 0d58a4f..00a18ca 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,28 @@ application. ## Folder structure -... +```text +. +└── . + ├── 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 -```bash -# Clone -git clone https://github.com/sergeyyarkov/node-docker-example.git . +- 1. Clone this repository `git clone https://github.com/sergeyyarkov/node-docker-example.git .` +- 2. Configure enviroment variables in `docker-compose.yml` if you need to +- 3. Build and run application with `docker compose up --build` -# Build -docker compose build +## Requirements -# Run -docker compose up -``` - -## Envitoment variables - -... +- Node.js >= v14.13.0 +- Docker