Skip to content

Commit

Permalink
UPDATE: readme and docs for the new argument and env format.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaspeters committed Aug 4, 2023
1 parent 6564fd0 commit ee9fc85
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 31 deletions.
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![Docs](https://img.shields.io/static/v1?label=&message=Issues&color=brightgreen)](https://github.com/m3scluster/compose/issues)
[![Chat](https://img.shields.io/static/v1?label=&message=Chat&color=brightgreen)](https://matrix.to/#/#mesosk3s:matrix.aventer.biz?via=matrix.aventer.biz)
[![Docs](https://img.shields.io/static/v1?label=&message=Docs&color=brightgreen)](https://m3scluster.github.io/compose/)
[![GoDoc](https://godoc.org/github.com/AVENTER-UG/mesos-compose?status.svg)](https://godoc.org/github.com/AVENTER-UG/mesos-compose)
[![Docker Pulls](https://img.shields.io/docker/pulls/avhost/mesos-compose)](https://hub.docker.com/repository/docker/avhost/mesos-compose/)

Mesos Framework to use docker-compose based files.

Expand Down Expand Up @@ -83,40 +85,48 @@ export MESOS_CNI="weave"

The compose file:

```bash
```yaml
version: '3.9'

services:
app:
image: alpine:latest
command: "sleep 1000"
command: "sleep"
arguments: ["1000"]
restart: always
volumes:
- "12345test:/tmp"
environment:
- MYSQL_HOST=test
MYSQL_HOST: test
hostname: test
container_name: test
container_type: docker # or mesos
shell: false
container_type: docker
shell: true
mesos:
task_name: "mc:test:app1" # an alternative taskname
task_name: "mc:test:app1" # an alternative taskname
executer:
command: "./my-custom-executor"
uri: "http://localhost/my-custom-executor"
command: "/mnt/mesos/sandbox/my-custom-executor"
fetch:
- value: http://localhost/my-custom-executor
executable: true
extract: false
cache: false
labels:
traefik.enable: "true"
traefik.http.routers.test.entrypoints: "web"
traefik.http.routers.test.service: "mc_test_app_80"
traefik.http.routers.test.service: "mc:test:app1:80" # if an alternative taskname is set, we have to use it here to
traefik.http.routers.test.rule: "HostRegexp(`example.com`, `{subdomain:[a-z]+}.example.com`)"
network_mode: "BRIDGE"
ports:
- "8080:80"
- "9090"
- "8081:81/tcp"
- "8082:82/udp"
network:
- default
- "8082:82/http"
- "8082:82/https"
- "8082:82/h2c"
- "8082:82/wss"
network: default
ulimits:
memlock:
soft: -1
Expand All @@ -128,21 +138,23 @@ services:
placement:
constraints:
- "node.hostname==localhost"
- "node.platform.os==linux"
- "node.platform.arch==arm"
replicas: 1
resources:
limits:
cpus: "0.01"
memory: "50"
cpus: 0.01
memory: 50

networks:
default:
external: true
name: weave
driver: bridge

volumes:
12345test:
driver: local

```
Expand Down
5 changes: 3 additions & 2 deletions docs/example/mesos-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ version: '3.9'
services:
app:
image: alpine:latest
command: "sleep 1000"
command: "sleep"
arguments: ["1000"]
restart: always
volumes:
- "12345test:/tmp"
environment:
- MYSQL_HOST=test
MYSQL_HOST: test
hostname: test
container_name: test
container_type: docker
Expand Down
36 changes: 22 additions & 14 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,34 @@

## Example

Compose file with all supportet parameters:
Compose file with all supported parameters:

```bash
```yaml
version: '3.9'

services:
app:
image: alpine:latest
command: "sleep 1000"
command: "sleep"
arguments: ["1000"]
restart: always
volumes:
- "12345test:/tmp"
environment:
- MYSQL_HOST=test
MYSQL_HOST: test
hostname: test
container_name: test
container_type: docker # or mesos
shell: false
container_type: docker
shell: true
mesos:
task_name: "mc:test:app1" # an alternative taskname
task_name: "mc:test:app1" # an alternative taskname
executer:
command: "./my-custom-executor"
uri: "http://localhost/my-custom-executor"
command: "/mnt/mesos/sandbox/my-custom-executor"
fetch:
- value: http://localhost/my-custom-executor
executable: true
extract: false
cache: false
labels:
traefik.enable: "true"
traefik.http.routers.test.entrypoints: "web"
Expand All @@ -43,8 +48,11 @@ services:
- "9090"
- "8081:81/tcp"
- "8082:82/udp"
network:
- default
- "8082:82/http"
- "8082:82/https"
- "8082:82/h2c"
- "8082:82/wss"
network: default
ulimits:
memlock:
soft: -1
Expand All @@ -61,18 +69,18 @@ services:
replicas: 1
resources:
limits:
cpus: "0.01"
memory: "50"
cpus: 0.01
memory: 50

networks:
default:
external: true
name: weave
driver: bridge

volumes:
12345test:
driver: local

```
We can also use yaml anchors and more then one service in a compose file:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/vault/vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
command: "env"
restart: always
environment:
- test=vault://secret/data/m3s/test:test1
test: vault://secret/data/m3s/test:test1
network: default
deploy:
resources:
Expand Down

0 comments on commit ee9fc85

Please sign in to comment.