- 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
.envfile, surely will be required at some point. -
If you would like to use MongoDB Atlas, add
MONGO_URIin the.envfile, with your DB connection URI. -
If you proceed to use sequelize, then add the following in the
.envfileSEQUELIZE_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/logsdirectory
-
Run
make up-devto run the dev environment, ormake up-prodfor the production environment. -
If you'd like to change container-port mapping, make changes in
docker-compose.ymlordocker-compose.prod.ymlfile, in thePORTSproperty -PORTS: "<your_new_port>:4000"
-
In case you decide to not use
docker-compose, make the same port-mapping change in therun-imagecommand in the Makefile. -
Visit
localhost:4000/welcometo 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