Help Center

JavaScript - Node.js + Redis

Node.js is a framework for the JavaScript language that allows you to create a web application using only this language, running JavaScript on the server side instead of in the browser. It is compatible with all other JavaScript frameworks, as well as with its own plugins and extensions.

Redis is an in-memory temporary database system that is easy to use and configure and achieves high efficiency and speed. Thanks to its caching system, it allows faster access to the data queried most frequently.

Project structure

text
.
β”œβ”€β”€ app
β”‚Β Β  β”œβ”€β”€ package.json
β”‚Β Β  β”œβ”€β”€ package-lock.json
β”‚Β Β  └── server.js
β”œβ”€β”€ app.Dockerfile
β”œβ”€β”€ compose.yaml
β”œβ”€β”€ nginx
β”‚   └── default.conf
β”œβ”€β”€ backup
β”‚   └── backup-runner.sh
β”œβ”€β”€ .env
└── .env.example

Deploying the application:

We change to the directory that contains the files required to build the container:

cd /root/stack/python/flask-mysql

We bring up the application:

text
docker compose up -d

Useful commands:

See the containers that are running:

text
docker compose ps

Stop and remove the application:

text
docker compose down

Rebuild the application after making changes to the code:

text
docker compose up -d --build
Guide g.0290 Β· Source version 1 Β· en