Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker-compose): support docker-compose.yml version 1 (#6596)
- Loading branch information
1 parent
e1ea26e
commit ec43556
Showing
5 changed files
with
277 additions
and
105 deletions.
There are no files selected for viewing
171 changes: 75 additions & 96 deletions
171
lib/manager/docker-compose/__fixtures__/docker-compose.1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,83 @@ | ||
version: "3" | ||
services: | ||
redis: | ||
image: quay.io/something/redis:alpine | ||
ports: | ||
- "6379" | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
redis: | ||
image: quay.io/something/redis:alpine | ||
ports: | ||
- "6379" | ||
networks: | ||
- frontend | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
worker: | ||
image: "node:10.0.0" | ||
|
||
worker: | ||
image: "node:10.0.0" | ||
db: | ||
image: "postgres:9.4.0" | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
db: | ||
image: "postgres:9.4.0" | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
networks: | ||
- backend | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
vote: | ||
image: dockersamples/examplevotingapp_vote:before | ||
ports: | ||
- 5000:80 | ||
depends_on: | ||
- redis | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
restart_policy: | ||
condition: on-failure | ||
|
||
vote: | ||
image: dockersamples/examplevotingapp_vote:before | ||
ports: | ||
- 5000:80 | ||
networks: | ||
- frontend | ||
depends_on: | ||
- redis | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
restart_policy: | ||
condition: on-failure | ||
result: | ||
image: 'dockersamples/examplevotingapp_result:before' | ||
ports: | ||
- 5001:80 | ||
depends_on: | ||
- db | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
result: | ||
image: 'dockersamples/examplevotingapp_result:before' | ||
ports: | ||
- 5001:80 | ||
networks: | ||
- backend | ||
depends_on: | ||
- db | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
votingworker: | ||
image: dockersamples/examplevotingapp_worker | ||
deploy: | ||
mode: replicated | ||
replicas: 1 | ||
labels: [APP=VOTING] | ||
restart_policy: | ||
condition: on-failure | ||
delay: 10s | ||
max_attempts: 3 | ||
window: 120s | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
votingworker: | ||
image: dockersamples/examplevotingapp_worker | ||
networks: | ||
- frontend | ||
- backend | ||
deploy: | ||
mode: replicated | ||
replicas: 1 | ||
labels: [APP=VOTING] | ||
restart_policy: | ||
condition: on-failure | ||
delay: 10s | ||
max_attempts: 3 | ||
window: 120s | ||
placement: | ||
constraints: [node.role == manager] | ||
visualizer: | ||
image: dockersamples/visualizer:stable | ||
ports: | ||
- "8080:8080" | ||
stop_grace_period: 1m30s | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
visualizer: | ||
image: dockersamples/visualizer:stable | ||
ports: | ||
- "8080:8080" | ||
stop_grace_period: 1m30s | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
edplugins: | ||
image: ${IMAGE:-synkodevelopers/edplugins}:${TAG:-latest} | ||
|
||
edplugins: | ||
image: ${IMAGE:-synkodevelopers/edplugins}:${TAG:-latest} | ||
|
||
debugapp: | ||
image: app-local-debug | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.local | ||
|
||
networks: | ||
frontend: | ||
backend: | ||
|
||
volumes: | ||
db-data: | ||
debugapp: | ||
image: app-local-debug | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.local |
104 changes: 104 additions & 0 deletions
104
lib/manager/docker-compose/__fixtures__/docker-compose.3.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
version: "3" | ||
services: | ||
|
||
redis: | ||
image: quay.io/something/redis:alpine | ||
ports: | ||
- "6379" | ||
networks: | ||
- frontend | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
worker: | ||
image: "node:10.0.0" | ||
|
||
db: | ||
image: "postgres:9.4.0" | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
networks: | ||
- backend | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
vote: | ||
image: dockersamples/examplevotingapp_vote:before | ||
ports: | ||
- 5000:80 | ||
networks: | ||
- frontend | ||
depends_on: | ||
- redis | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
restart_policy: | ||
condition: on-failure | ||
|
||
result: | ||
image: 'dockersamples/examplevotingapp_result:before' | ||
ports: | ||
- 5001:80 | ||
networks: | ||
- backend | ||
depends_on: | ||
- db | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
votingworker: | ||
image: dockersamples/examplevotingapp_worker | ||
networks: | ||
- frontend | ||
- backend | ||
deploy: | ||
mode: replicated | ||
replicas: 1 | ||
labels: [APP=VOTING] | ||
restart_policy: | ||
condition: on-failure | ||
delay: 10s | ||
max_attempts: 3 | ||
window: 120s | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
visualizer: | ||
image: dockersamples/visualizer:stable | ||
ports: | ||
- "8080:8080" | ||
stop_grace_period: 1m30s | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
edplugins: | ||
image: ${IMAGE:-synkodevelopers/edplugins}:${TAG:-latest} | ||
|
||
debugapp: | ||
image: app-local-debug | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.local | ||
|
||
networks: | ||
frontend: | ||
backend: | ||
|
||
volumes: | ||
db-data: |
70 changes: 69 additions & 1 deletion
70
lib/manager/docker-compose/__snapshots__/extract.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.