Skip to content

Commit

Permalink
Add documentation for running the app in a Docker image #9
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Nov 24, 2020
1 parent 752ed46 commit f8a4b77
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 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://github.com/nexB/scancode.io/issues/9

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

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
build: .
environment:
- SCANCODEIO_DB_HOST=db
# Required by metaflow to prevent raising MetaflowUnknownUser
- USERNAME=scancodeio
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
Expand Down
54 changes: 54 additions & 0 deletions docs/docker-image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.. _docker_image:

Docker image
============

Get Docker
----------

The first step is to download and install Docker on your platform.
Refer to the following Docker documentation and choose the best installation
path for you: `Get Docker <https://docs.docker.com/get-docker/>`_

Build the Image
---------------

ScanCode.io is distributed with ``Dockerfile`` and ``docker-compose.yml`` files
required for the creation of the Docker image.

Build the image::

$ docker-compose build


.. note::
The image will need to be re-build when the ScanCode.io app source code if
modified or updated.

Run the Image
-------------

Run your image as a container::

$ docker-compose up


At this point, the ScanCode.io app should be running at port 8000 on your
Docker host.
Go to http://localhost:8000 on a web browser to access the web UI.

You can also run a one-off ``scanpipe`` command through the Docker command line
interface, for example::

$ docker-compose run web scanpipe create-project project_name


.. note::
Refer to :ref:`scanpipe_command_line` for the full list of commands.

Alternatively, you can connect to the Docker container ``bash`` and run commands
from there::

$ docker-compose run web bash
$ scanpipe create-project project_name

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ First application is for Docker container and VM composition analysis.

introduction
installation
docker-image

.. toctree::
:maxdepth: 2
Expand Down
4 changes: 4 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Pre-requisite
* **PostgreSQL 10** or later: https://www.postgresql.org/ (or https://postgresapp.com/ on macOS)
* Recent version of **git**: https://git-scm.com/

.. note::
ScanCode.io can also be run through a Docker image,
refer to the :ref:`docker_image` chapter for details.

Local installation
------------------

Expand Down

0 comments on commit f8a4b77

Please sign in to comment.