Skip to content

Commit

Permalink
Add support for running ScanCode.io as a Docker image #9
Browse files Browse the repository at this point in the history
  • Loading branch information
tdruez authored Nov 25, 2020
1 parent 72353b6 commit 33ec157
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 208 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

### v1.0.5 (unreleased)

- Add support for running ScanCode.io as a Docker image
https:/nexB/scancode.io/issues/9

- Add support for Python 3.7, 3.8, and 3.9
https:/nexB/scancode.io/issues/54

Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /opt/scancodeio/
WORKDIR /opt/scancodeio/
COPY etc/requirements/base.txt /opt/scancodeio/
RUN pip install -r base.txt
COPY . /opt/scancodeio/
RUN pip install .
202 changes: 0 additions & 202 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ MANAGE=bin/python manage.py
ACTIVATE?=. bin/activate;
ANSIBLE_PLAYBOOK=cd etc/ansible/ && ansible-playbook --inventory-file=hosts --verbose --ask-become-pass --user=${USER}
BLACK_ARGS=--exclude="migrations|data|docs" .
GET_SECRET_KEY=`${PYTHON_EXE} -c "from django.core.management import utils; print(utils.get_random_secret_key())"`
# Do not depend on Python to generate the SECRET_KEY
GET_SECRET_KEY=`base64 /dev/urandom | head -c50`
# Customize with `$ make envfile ENV_FILE=/etc/scancodeio/.env`
ENV_FILE=.env
# Customize with `$ make postgres SCANCODEIO_DB_PASSWORD=YOUR_PASSWORD`
Expand All @@ -44,7 +45,7 @@ conf:
@echo "-> Configure the Python venv and install dependencies"
${PYTHON_EXE} -m venv .
@${ACTIVATE} pip install -r etc/requirements/base.txt
@${ACTIVATE} pip install -e .
@${ACTIVATE} pip install --editable .

dev: conf
@echo "-> Configure and install development dependencies"
Expand All @@ -56,7 +57,7 @@ envfile:
@echo "-> Create the .env file and generate a secret key"
@if test -f ${ENV_FILE}; then echo ".env file exists already"; exit 1; fi
mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
@${ACTIVATE} echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}

install:
@echo "-> Install and configure the Python env with base dependencies, offline"
Expand Down
Loading

0 comments on commit 33ec157

Please sign in to comment.