Skip to content

Add docker #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.7.4

COPY . /app
WORKDIR "/app"

# Development version:

RUN pip install -r requirements.txt && \
pip install -r requirements-optional.txt

RUN python3.7 setup.py develop
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ Build the documentation like so. ::

Outputs will go in ``doc/_*``.

**Developing in Docker**

You can run and develop in a docker container. Install docker. Then:

docker-compose build
docker-compose run --service-ports cubes /bin/bash

In that bash shell, you can run the examples. The cubes server on
port 5000 inside the container will be accessible on port 5005 outside
(see docker-compose.yaml).

Requirements
------------
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
cubes:
build: .
environment:
- PYTHONDONTWRITEBYTECODE=true
- PYTHONPATH=.
volumes:
# mount current directory so that changes in files are reflected
# in the running environment
- .:/app
# Open up 5005, hopefully not in conflict with any other you may be running
ports:
- "5005:5000"
5 changes: 2 additions & 3 deletions examples/hello_world/slicer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
log_level: info

[server]
host: localhost
# 0.0.0.0 is accessible outside Docker if mapped
host: 0.0.0.0
port: 5000
reload: yes
prettyprint: yes
Expand All @@ -14,5 +15,3 @@ url: sqlite:///data.sqlite

[models]
main: model.json