Skip to content

Commit

Permalink
Update docker-compose configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
0GiS0 committed Oct 13, 2023
1 parent 35a1931 commit 0019b64
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 40 deletions.
14 changes: 0 additions & 14 deletions .devcontainer/Dockerfile

This file was deleted.

7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers-contrib/features/snyk-cli:1": {}
"ghcr.io/devcontainers-contrib/features/snyk-cli:1": {},
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
Expand All @@ -25,10 +26,10 @@
"GitHub.copilot"
]
}
}
},

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
"postCreateCommand": "npm install -g @cyclonedx/cdxgen"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
12 changes: 6 additions & 6 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ volumes:

services:
app:
build:
context: .
dockerfile: Dockerfile
# build:
# context: .
# dockerfile: Dockerfile
image: mcr.microsoft.com/devcontainers/dotnet:0-7.0
volumes:
- ../..:/workspaces:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
# network_mode: service:dtrack-apiserver
network_mode: service:dtrack-apiserver

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
Expand Down Expand Up @@ -121,7 +122,6 @@ services:
volumes:
- 'dependency-track:/data'
restart: unless-stopped

dtrack-frontend:
image: dependencytrack/frontend
depends_on:
Expand All @@ -142,4 +142,4 @@ services:
# - "/host/path/to/config.json:/app/static/config.json"
ports:
- "8080:8080"
restart: unless-stopped
restart: unless-stopped
55 changes: 40 additions & 15 deletions steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ snyk auth
git clone https://github.com/0GiS0/tour-of-heroes-angular.git && cd tour-of-heroes-angular
npm install

cdxgen -o bom.json
cdxgen -o bom.1.4.json --spec-version 1.4


# Trying API REST
curl https://reimagined-xylophone-vp9qqwj64fx67w-8080.app.github.dev/api/version -w '%{response_code}'
curl http://localhost:8080/api/version -w '%{response_code}'

curl -X "PUT" "https://reimagined-xylophone-vp9qqwj64fx67w-8080.app.github.dev/api/v1/bom" \
curl -X "PUT" "http://localhost:8080/api/v1/bom" \
-H 'Content-Type: multipart/form-data' \
-H 'X-Api-Key: BgCIvb2ZuIEiuaZBiOZ5JhmQdD8I4Iop' \
-F 'project=00ca1b30-3746-4da1-abae-f0b45a6d9906' \
-F '[email protected]' \
-w '%{response_code}'

curl -X "POST" "https://reimagined-xylophone-vp9qqwj64fx67w-8080.app.github.dev/api/v1/bom" \


curl -X "PUT" "http://localhost:8080/api/v1/bom" \
-H 'Content-Type: multipart/form-data' \
-H "X-Api-Key: BgCIvb2ZuIEiuaZBiOZ5JhmQdD8I4Iop" \
-F "autoCreate=true" \
-F "projectName=tour-of-heroes-test" \
-F "projectVersion=1.0.0" \
-F "[email protected]" \
-H 'X-Api-Key: BgCIvb2ZuIEiuaZBiOZ5JhmQdD8I4Iop' \
-F 'project=81d1c70e-5527-4d1d-bdd0-15d6120badcb' \
-F '[email protected]' \
-w '%{response_code}'


Expand All @@ -36,11 +36,36 @@ curl -X "POST" "https://reimagined-xylophone-vp9qqwj64fx67w-8080.app.github.dev/
git clone https://github.com/0GiS0/tour-of-heroes-dotnet-api.git && cd tour-of-heroes-dotnet-api
dotnet build

spdx-sbom-generator --format json
# npm install -g @cyclonedx/cdxgen
export FETCH_LICENSE=true
cdxgen -o bom-with-license.json --spec-version 1.4

curl -X "PUT" "https://reimagined-xylophone-vp9qqwj64fx67w-8081.app.github.dev/api/v1/bom" \
curl -X "POST" "http://localhost:8080/api/v1/bom" \
-H 'Content-Type: multipart/form-data' \
-H 'X-Api-Key: BgCIvb2ZuIEiuaZBiOZ5JhmQdD8I4Iop' \
-F 'project=81d1c70e-5527-4d1d-bdd0-15d6120badcb' \
-F '[email protected]' \
-w '%{response_code}'
-H "X-Api-Key: QN0pNzIFxraSqO4U97kvLsFoCv8zfHR8" \
-F "autoCreate=true" \
-F "projectName=tour-of-heroes-test" \
-F "projectVersion=1.0.0" \
-F "[email protected]" \
-w '%{response_code}'

# Test license
git clone https://github.com/dephell/dephell.git && cd dephell
cdxgen -o bom.1.4.json --spec-version 1.4

curl -X "POST" "http://localhost:8080/api/v1/bom" \
-H 'Content-Type: multipart/form-data' \
-H "X-Api-Key: QN0pNzIFxraSqO4U97kvLsFoCv8zfHR8" \
-F "autoCreate=true" \
-F "projectName=dephell-test" \
-F "projectVersion=1.0.0" \
-F "[email protected]" \
-w '%{response_code}'


# FOSSA
# Install fossa-cli
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
export FOSSA_API_KEY='YOUR_API_KEY'
# Run an analysis
fossa analyze
1 change: 0 additions & 1 deletion tour-of-heroes-angular
Submodule tour-of-heroes-angular deleted from 58aa38
1 change: 0 additions & 1 deletion tour-of-heroes-dotnet-api
Submodule tour-of-heroes-dotnet-api deleted from 9b8a5e

0 comments on commit 0019b64

Please sign in to comment.