Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/emapeire/docker-node
- Owner: emapeire
- License: mit
- Created: 2024-04-30T22:43:39.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-02T16:51:30.000Z (7 months ago)
- Last Synced: 2024-05-03T15:26:19.492Z (7 months ago)
- Topics: docker, docker-compose, docker-container, docker-image, dockerfile, dockerhub, express, javascript, mongodb, mongoose, msql2, mysql-database, nodejs
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.