forked from aboutcode-org/vulnerablecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File hierarchy inside docker container now looks similar to scancodeio. postgres data is now a docker volume, so it will persist even after recreation. .dockerignores makes sure that we don't overpopulate docker images, improving build times. A common environment variable for containers is kept in docker.env The python image we are using now explicitly states python:3.8 NOTE: We should have a postgres health check script which uses python manage.py check --database default which comes with max_retries and backoffs for `vulnerablecode` container. Currently, docker's `restart:` option is used but it has a caveat that it'll restart on non-db errors as well. Signed-off-by: Hritik Vijay <[email protected]>
- Loading branch information
Showing
5 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
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,4 @@ | ||
.git | ||
.github | ||
|
||
venv |
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,10 +1,11 @@ | ||
FROM python:3.9.6 | ||
FROM python:3.8 | ||
|
||
# Force unbuffered stdout and stderr (i.e. they are flushed to terminal immediately) | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN mkdir /vulnerablecode | ||
WORKDIR /vulnerablecode | ||
COPY . /vulnerablecode/ | ||
RUN mkdir /opt/vulnerablecode && \ | ||
mkdir -p /var/vulnerablecode/static/ | ||
WORKDIR /opt/vulnerablecode | ||
COPY . . | ||
RUN python -m pip install --upgrade pip && \ | ||
pip install -r requirements.txt | ||
pip install -r requirements.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
DJANGO_SETTINGS_MODULE=vulnerablecode.settings | ||
|
||
POSTGRES_DB=vulnerablecode | ||
POSTGRES_USER=vulnerablecode | ||
POSTGRES_PASSWORD=vulnerablecode | ||
|
||
GUNICORN_SERVER=vulnerablecode | ||
DJANGO_SETTINGS_MODULE=vulnerablecode.settings | ||
VULNERABLECODE_DB_HOST=db | ||
|
||
VC_DB_HOST=db | ||
GUNICORN_SERVER=vulnerablecode |
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 |
---|---|---|
|
@@ -15,6 +15,6 @@ server { | |
} | ||
|
||
location /static/ { | ||
alias /vulnerablecode/static/; | ||
alias /var/vulnerablecode/static/; | ||
} | ||
} |