Dockerize vulnerablecode - #256
Conversation
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
|
This is a repaste of the issue I am facing from gitter :
|
When the project is ran in docker containers the `db` container is not on `localhost` as specified in `settings.py`. To counter this an env variable `DB_HOST` is used to specify where the db is hosted. Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
pombredanne
left a comment
There was a problem hiding this comment.
Thanks!
LGTM except for some weird spacing and a suggestion on Docker image.
| RUN mkdir /vulnerablecode | ||
| WORKDIR /vulnerablecode | ||
| ADD . /vulnerablecode/ | ||
| RUN pip install -r requirements.txt No newline at end of file |
There was a problem hiding this comment.
Can we add some labels to the image such that we know its base image, origin and license, author, maintainers, etc? (See how complicated a Docker image analysis can be with https://github.com/nexB/scancode.io/blob/main/scanpipe/pipelines/docker.py )
ddbc85c to
1d6e67e
Compare
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
pombredanne
left a comment
There was a problem hiding this comment.
See my suggestions inline. Note that at this stage we may want to start using ReST for the README and docs like for the other projects ... but this should another PR.
| The easiest way to set up VulnerableCode is by using the docker containers. | ||
| For this you need to have the following installed. | ||
| - Docker Engine. Find instructions to install it here | ||
| - Docker Compose. Find instructions to install it here |
There was a problem hiding this comment.
What about this:
| - Docker Compose. Find instructions to install it here | |
| An easy way to set up VulnerableCode is with docker containers and docker compose. | |
| For this you need to have the following installed. | |
| - Docker Engine at https://docs.docker.com/engine/install/ | |
| - Docker Compose at https://docs.docker.com/compose/install/ |
| - DJANGO_DEV=1 | ||
| - VC_DB_HOST=db | ||
| build: . | ||
| command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000" |
There was a problem hiding this comment.
Why the "web" service have to "makemigrations"?
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
| LABEL "base_image": "pkg:docker/python@sha256%3Ae9b7e3b4e9569808066c5901b8a9ad315a9f14ae8d3949ece22ae339fff2cad0" | ||
| LABEL "dockerfile_url": "https://github.com/nexB/vulnerablecode/blob/develop/Dockerfile" | ||
| LABEL "homepage_url": "https://github.com/nexB/vulnerablecode" | ||
| LABEL "license": "Apache-2.0" No newline at end of file |
Fixes #229
Signed-off-by: Shivam Sandbhor shivam.sandbhor@gmail.com