- Typescript
- Docker
- Logging (with Winston)
- Sequelize for SQL DB (currently using PostgreSQL in this project)
-
Clone the project or create a new project using this as a template.
-
Install dependencies using
npm i
-
Add a
.env
file, surely will be required at some point. -
If you would like to use MongoDB Atlas, add
MONGO_URI
in the.env
file, with your DB connection URI. -
If you proceed to use sequelize, then add the following in the
.env
fileSEQUELIZE_DIALECT=/* one of 'mysql' | 'mariadb' | 'postgres' | 'mssql' */ SEQUELIZE_PORT=your_db_port SEQUELIZE_DATABASE_NAME=your_db_name SEQUELIZE_DATABASE_USERNAME=your_username SEQUELIZE_DATABASE_PASSWORD=your_password
-
All log files are generated in
./src/logs
directory
-
Run
make up-dev
to run the dev environment, ormake up-prod
for the production environment. -
If you'd like to change container-port mapping, make changes in
docker-compose.yml
ordocker-compose.prod.yml
file, in thePORTS
property -PORTS: "<your_new_port>:4000"
-
In case you decide to not use
docker-compose
, make the same port-mapping change in therun-image
command in the Makefile. -
Visit
localhost:4000/welcome
to check if everything is working. -
Feel free to make any other changes, according to your project needs.
- better understanding about simple and complex concepts of Docker, alongside NodeJS.
- setup a node/express application using Docker.
- create and optimize workflows using Dockerfile, docker-compose and Makefile.
- create and support multiple environments -
development
|production
. - create separate loggers for development and production environment using Winston
- docker commands
- container port mapping