chore: add examples
This commit is contained in:
parent
e8ed141c09
commit
a71f82572c
8 changed files with 76 additions and 12 deletions
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -29,6 +29,7 @@ jobs:
|
|||
docker compose -f tests/ymls/networks/docker-compose.yml config -q
|
||||
docker compose -f tests/ymls/ports/docker-compose.yml config -q
|
||||
docker compose -f tests/ymls/volumes/docker-compose.yml config -q
|
||||
docker compose -f examples/full-stack-node-app/docker-compose.yml config -q
|
||||
|
||||
- name: Setup Python 3.10.4
|
||||
uses: actions/setup-python@v3
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -159,3 +159,5 @@ cython_debug/
|
|||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
*.png
|
||||
|
|
59
examples/full-stack-node-app/docker-compose.yml
Normal file
59
examples/full-stack-node-app/docker-compose.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
version: "3.9"
|
||||
|
||||
services:
|
||||
node:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.node
|
||||
|
||||
api:
|
||||
image: "awesome/api"
|
||||
extends:
|
||||
service: node
|
||||
build:
|
||||
args:
|
||||
PACKAGE_PATH: api
|
||||
WORKING_DIR: /usr/src/
|
||||
expose:
|
||||
- 8000
|
||||
ports:
|
||||
- 8000:8000
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
volumes:
|
||||
- ./api:/usr/src
|
||||
depends_on:
|
||||
- postgres
|
||||
- adminer
|
||||
command: ["npm", "start"]
|
||||
|
||||
frontend:
|
||||
extends:
|
||||
service: node
|
||||
build:
|
||||
args:
|
||||
PACKAGE_PATH: frontend
|
||||
WORKING_DIR: /usr/src/
|
||||
expose:
|
||||
- 3000
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
- REACT_APP_ENV=development
|
||||
- BACKEND=api:8000
|
||||
- HTTPS=true
|
||||
- NODE_PATH=/usr/src/
|
||||
volumes:
|
||||
- ./frontend:/usr/src
|
||||
depends_on:
|
||||
- api
|
||||
command: ["npm", "start"]
|
||||
|
||||
postgres:
|
||||
image: postgres
|
||||
restart: always
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
ports:
|
||||
- 8080:8080
|
|
@ -11,17 +11,19 @@ runner = CliRunner()
|
|||
@pytest.mark.parametrize(
|
||||
"test_file_path",
|
||||
[
|
||||
"builds/docker-compose",
|
||||
"depends_on/docker-compose",
|
||||
"extends/docker-compose",
|
||||
"links/docker-compose",
|
||||
"networks/docker-compose",
|
||||
"ports/docker-compose",
|
||||
"volumes/docker-compose",
|
||||
"tests/ymls/builds/docker-compose.yml",
|
||||
"tests/ymls/depends_on/docker-compose.yml",
|
||||
"tests/ymls/extends/docker-compose.yml",
|
||||
"tests/ymls/links/docker-compose.yml",
|
||||
"tests/ymls/networks/docker-compose.yml",
|
||||
"tests/ymls/others/docker-compose.yml",
|
||||
"tests/ymls/ports/docker-compose.yml",
|
||||
"tests/ymls/volumes/docker-compose.yml",
|
||||
"examples/full-stack-node-app/docker-compose.yml",
|
||||
],
|
||||
)
|
||||
def test_cli(test_file_path: str) -> None:
|
||||
input_path = f"tests/ymls/{test_file_path}.yml"
|
||||
input_path = f"{test_file_path}"
|
||||
output_path = "compose-viz-test.png"
|
||||
result = runner.invoke(cli.app, ["-o", output_path, input_path])
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ services:
|
|||
image: awesome/backend
|
||||
build:
|
||||
context: backend
|
||||
dockerfile: ../backend.Dockerfile
|
||||
dockerfile: ../backend.Dockerfile
|
||||
|
|
|
@ -11,4 +11,4 @@ services:
|
|||
derive_from_file:
|
||||
extends:
|
||||
file: web.yml
|
||||
service: web
|
||||
service: web
|
||||
|
|
|
@ -2,4 +2,4 @@ version: "3.9"
|
|||
|
||||
services:
|
||||
web:
|
||||
image: awesome/web
|
||||
image: awesome/web
|
||||
|
|
|
@ -6,4 +6,4 @@ services:
|
|||
links:
|
||||
- "db:database"
|
||||
db:
|
||||
image: mysql
|
||||
image: mysql
|
||||
|
|
Loading…
Reference in a new issue