For learning how to develop an application with cloud-native ready.
5.2K
This project is for learning Nodejs (Express and Pug)
docker build -t nodejs-express:latest .
docker run --name nodejs-express -d -e DBHOST="your-database-host" -e DBPASS="your-database-password" -e DBNAME="mydb" -p 80:8080 nodejs-express:latest
Build and run from source
docker compose up -d --build
Run from built image
docker compose up -d
| Variable name | Description | Default | Mandatory |
|---|---|---|---|
| PORT | Application Port | 8080 | YES |
| DBHOST | Database IP/Hostname | localhost | YES |
| DBPORT | Database Port | 5432 | YES |
| DBUSER | Database Username | postgres | YES |
| DBPASS | Database Password | postgres | YES |
| DBNAME | Database Name | postgres | YES |
| POD_NAME | Pod Name | unset | NO |
| NAMESPACE | Namespace | unset | NO |
| NODENAME | Node Name | unset | NO |
http://<container-ip>
http://<container-ip>/metrics
http://<container-ip>/api/v1
| Module Name | Source | Description |
|---|---|---|
| express | express | Create REST Server |
| pug | pug | Template Engine |
| cors | cors | Enable CORS in Node.js |
| morgan | morgan | HTTP Request Logger |
| helmet | helmet | Middleware for more Security |
| compression | compression | Compress Response's Body |
| pg | pg | PostgreSQL Connector |
| axios | axios | HTTP Client for Node.js |
| prom-client | prom-client | Prometheus client for Node.js |
Strict to Google JS Style Guide: https://google.github.io/styleguide/jsguide.html with eslint.
Content type
Image
Digest
sha256:da3304616…
Size
93.7 MB
Last updated
about 2 years ago
docker pull bankierubybank/nodejs-express