https://github.com/xoac/mongo-docker-compose
Repository that contains mongo and compose in one image
https://github.com/xoac/mongo-docker-compose
Last synced: 16 days ago
JSON representation
Repository that contains mongo and compose in one image
- Host: GitHub
- URL: https://github.com/xoac/mongo-docker-compose
- Owner: xoac
- Created: 2021-04-07T09:11:23.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-04T11:07:24.000Z (over 4 years ago)
- Last Synced: 2025-01-20T00:55:33.494Z (12 months ago)
- Language: Dockerfile
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mongo-compose
This image contains [mongo] with installed docker-compose
You can find images on docker-hub: [sylwekrapala/mongo-docker-compose]
## Usage
It was build to be used with gitlab ci
Example `.gitlab-ci.yml`
```
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
test:
image:
name: sylwekrapala/mongo-compose:4.4 # cached install of compose in mongo image https://github.com/xoac/mongo-compose/blob/v4.4/Dockerfile
entrypoint: [""]
envirnoments:
MONGO_INITDB_ROOT_USERNAME: "root"
MONGO_INITDB_ROOT_PASSWORD: "root" # TODO
MONGODB_HOST: docker:27017 # why not localhost? see: https://gitlab.com/gitlab-org/gitlab/-/issues/16890#note_214935601
before_script:
- docker version
- docker-compose version
- docker-compose up -d
script:
# example test script
- mongo --verbose -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD mongodb://$MONGODB_HOST < test.js
after_script:
- docker-compose -f ./docker/docker-compose.yml --env-file "$ENV_FILE" down
```
## Versioning
The tags match the same as in official [mongo]. Minimum version of docker-compose will be 1.29.1.
[mongo]: https://hub.docker.com/_/mongo
[sylwekrapala/mongo-docker-compose]: https://hub.docker.com/r/sylwekrapala/mongo-docker-compose