Added stack.yml
This commit is contained in:
parent
739ae9a6b9
commit
0a2875e917
|
|
@ -34,29 +34,9 @@ $ docker run -it --link some-%%REPO%%:mongo --rm %%IMAGE%% sh -c 'exec mongo "$M
|
|||
```
|
||||
... where `some-mongo` is the name of your original `mongo` container.
|
||||
|
||||
## ... via `docker-compose`
|
||||
## %%STACK%%
|
||||
|
||||
Example `docker-compose.yml` for `mongo`:
|
||||
|
||||
```
|
||||
version: '2.1'
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
image: %%IMAGE%%
|
||||
restart: always
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: MongoRootUser
|
||||
MONGO_INITDB_ROOT_PASSWORD: AMuchStrongerPassword
|
||||
|
||||
app:
|
||||
build: ./app
|
||||
ports:
|
||||
- 80:80
|
||||
links:
|
||||
- db
|
||||
```
|
||||
Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8081`, `http://localhost:8081`, or `http://host-ip:8081` (as appropriate).
|
||||
|
||||
## Container shell access and viewing Mongo logs
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
# Use root/example as user/password credentials
|
||||
version: '3.1'
|
||||
|
||||
services:
|
||||
|
||||
mongo:
|
||||
image: mongo
|
||||
# image: %%IMAGE%%
|
||||
restart: always
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: example
|
||||
|
||||
mongo-express:
|
||||
image: mongo-express
|
||||
restart: always
|
||||
ports:
|
||||
- 8081:8081
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: root
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: example
|
||||
Loading…
Reference in New Issue