Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emapeire/docker-node

Docker Node 🐳: learn best practices
https://github.com/emapeire/docker-node

docker docker-compose docker-container docker-image dockerfile dockerhub express javascript mongodb mongoose msql2 mysql-database nodejs

Last synced: 2 days ago
JSON representation

Docker Node 🐳: learn best practices

Awesome Lists containing this project

README

        

# Docker Node 🐳: learn best practices

### About the project

A simple Node.js project with Docker, MongoDB and MySQL

### Setting up the project

You'll need to configure the environment variables for the project. To do this, you can create a `.env` file in the root of the project with the following content:

```env
# Docker Configuration
# Defining true you are saying that you are running the application in a docker environment.
# Otherwise (false), you are running the application in a local environment.
IS_DOCKER_ENV=

# Application Configuration
APP_CONTAINER_NAME=
APP_PORT= # Default: 3000

# MySQL Configuration
MYSQL_CONTAINER_HOST=
MYSQL_PORT= # Default: 3306
MYSQL_DATABASE=
MYSQL_ROOT_USER=
MYSQL_ROOT_PASSWORD=

# MongoDB Configuration
MONGO_CONTAINER_HOST=
MONGO_DATABASE=
MONGO_PORT= # Default: 27017
```

Also, you can look at the [`.env.example`](.env.example) file to see an example of the environment variables.

### Running the project

To run the project, you'll need to have Docker installed. Then, you can run the following command:

```bash
docker-compose up
```

For building the project, you can run the following command:

```bash
docker-compose up --build
```

This will build the Docker image and start the container. You can access the application at `http://localhost:3000`.

### Stopping the project

To stop the project, you can run the following command:

```bash
docker-compose down
```

This will stop the container and remove it.

### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.