Skip to content

Commit

Permalink
Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
coagulant committed Jan 26, 2017
1 parent 1de6aab commit 73d5390
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ script:

after_success:
- coveralls

deploy:
provider: script
script: make travis-build-docker
on:
branch: master
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.5-slim
MAINTAINER The MyBook Developers <dev@mybook.ru>

RUN groupadd critics && useradd --no-create-home --gid critics critics

COPY . /tmp/critics
WORKDIR /tmp/critics
RUN pip install -e .

EXPOSE 9137
USER critics
ENTRYPOINT [ "/usr/local/bin/critics" ]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,10 @@ dist: clean

install: clean
python setup.py install

travis-build-docker:
@if [ "${TRAVIS_BRANCH}" = "master" ]; then\
docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD};\
docker build -t ${DOCKER_REPO}:latest -t ${DOCKER_REPO}:${TRAVIS_COMMIT_SHORT} .;\
docker push ${DOCKER_REPO};\
fi

0 comments on commit 73d5390

Please sign in to comment.