Skip to content

Commit c8c46d8

Browse files
committed
Add docker and compose
1 parent d66e193 commit c8c46d8

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:2.7-alpine
2+
3+
# Create app directory
4+
RUN mkdir -p /usr/src/app
5+
WORKDIR /usr/src/app
6+
7+
# Bundle app source
8+
COPY . /usr/src/app
9+
10+
ENTRYPOINT [ "python", "project" ]

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
## Introduction
22

3-
This project is an example for a python command-line application structure with a unit testing framework
3+
This project is an example for a python command-line application structure with a unit testing framework.
44

55
## Prerequisites
66

7-
* [nose](http://code.google.com/p/python-nose/)
8-
* [mockito](http://code.google.com/p/mockito-python/)
9-
10-
### Installation on OSX
11-
12-
sudo easy_install nose
13-
sudo easy_install mockito
7+
* [docker](https://www.docker.com/)
148

159
## Running the Application
1610

17-
python project [arguments]
11+
docker-compose build
12+
docker-compose run project <command line arguments>
1813

1914
## Testing
2015

21-
python project/tests
16+
docker-compose run test

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3'
2+
3+
services:
4+
project:
5+
build: .
6+
7+
test:
8+
build: test
9+
volumes:
10+
- .:/src

test/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:2.7-alpine
2+
3+
COPY requirements.txt /tmp/requirements.txt
4+
RUN pip install -r /tmp/requirements.txt
5+
6+
CMD ["python", "/src/project/tests"]

test/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nose
2+
mockito

0 commit comments

Comments
 (0)