This commit is contained in:
Sergey Yarkov 2022-03-22 22:24:00 +03:00
parent 9dcd55d229
commit 1093167ed6
2 changed files with 26 additions and 13 deletions

6
.env.example Normal file
View File

@ -0,0 +1,6 @@
PORT=4000
PG_HOST=<db_host>
PG_PORT=<db_port>
PG_USER=<db_user>
PG_PASSWORD=<db_password>
PG_DB_NAME=<db_database_name>

View File

@ -9,21 +9,28 @@ application.
## Folder structure ## 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 ## How to deploy
```bash - 1. Clone this repository `git clone https://github.com/sergeyyarkov/node-docker-example.git .`
# Clone - 2. Configure enviroment variables in `docker-compose.yml` if you need to
git clone https://github.com/sergeyyarkov/node-docker-example.git . - 3. Build and run application with `docker compose up --build`
# Build ## Requirements
docker compose build
# Run - Node.js >= v14.13.0
docker compose up - Docker
```
## Envitoment variables
...