Skip to content

Commit f6caa74

Browse files
author
Fabian Ihl
committed
Merge branch 'feature/docker'
2 parents c08cd9f + a03dcc9 commit f6caa74

8 files changed

Lines changed: 493 additions & 0 deletions

File tree

.pylintrc

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:alpine
2+
3+
ARG TARGET=development
4+
5+
ADD . /code
6+
WORKDIR /code
7+
RUN pip install --no-cache-dir --upgrade -r requirements/base.txt -r requirements/$TARGET.txt

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# target config
2+
TARGET=development
3+
CFLAGS = -c -g -D $(TARGET)
4+
5+
# Content of the pre-commit hook
6+
define PRECOMMIT
7+
#!/bin/sh
8+
make lint
9+
endef
10+
export PRECOMMIT
11+
12+
all: images up
13+
14+
images:
15+
docker-compose build
16+
17+
up:
18+
docker-compose up mongo rabbitmq postgres
19+
20+
lint:
21+
docker-compose run --rm py find . -name "*.py" -exec pylint -ry {} +
22+
23+
install_pre_commit:
24+
echo "$$PRECOMMIT" > .git/hooks/pre-commit
25+
chmod +x .git/hooks/pre-commit
26+
27+
test:
28+
docker-compose run --rm py python -m unittest
29+
30+
coverage:
31+
docker-compose run --rm py sh -c 'coverage run -m unittest && coverage html && coverage report'

docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '2'
2+
services:
3+
py:
4+
build: .
5+
image: "py"
6+
volumes:
7+
- .:/code
8+
#command: python main.py
9+
# other handy stuff:
10+
mongo:
11+
image: "mongo"
12+
#ports:
13+
# - "27017:27017"
14+
rabbitmq:
15+
image: "rabbitmq:management-alpine"
16+
# admin dashboard http://localhost:8080/ user:guest pw:guest
17+
ports:
18+
- "8080:15672"
19+
postgres:
20+
image: postgres
21+
#ports:
22+
# - "5432:5432"
23+
environment:
24+
- POSTGRES_PASSWORD=postgres
25+
- POSTGRES_DB=postgres

requirements/base.txt

Whitespace-only changes.

requirements/development.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage
2+
ipython
3+
pylint

requirements/production

Whitespace-only changes.

requirements/test.txt

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

0 commit comments

Comments
 (0)