Skip to content

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container

Notifications You must be signed in to change notification settings

jadilson12/docker-compose-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container :

  • mongodb:latest

Mongodb Container Configuration

  1. Expose port

    • 12017
  2. Volume (Note: check if in the docker configuration -> shared drivers, the units are enabled)

    • Application database: ./docker/mongo/data -> /data/db

How to use

  1. Clone the repository using the command:
$ git clone https://github.com/jadilson12/docker-compose-mongo
  1. Enter the folder docker-compose-mongo copy the files
$ cp env-example .env
$ cp docker-compose.yml-example docker-compose.yml
  1. Run your container:
$ docker-compose up -d
  1. Access the container shell:
$ docker exec -it app-database sh

Show your support

Give a ⭐️ if this project helped you!

Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

author

Jadilson Guedes jadilson12@gmail.com
License MIT https://jadilson12.mit-license.org/

About

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published