Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
nhumrich committed Sep 22, 2017
1 parent 0ec5b84 commit 7ab83f6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ Dockerfile
docker-compose.yml
Dockerfile-dev
wercker.yml
.gitlab-ci.yml
cnpy-deployment.yaml
tests/
.vscode/
.idea/
readme.md
.coverage
.pylintrc


# Byte-compiled / optimized / DLL files
Expand Down
18 changes: 17 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,27 @@ build:
after_script:
- docker push $REPO_NAME:$CI_COMMIT_SHA

lint:
image: $REPO_NAME:$CI_COMMIT_SHA
stage: test
script:
- invoke lint

test:
services:
- postgres
image: $REPO_NAME:$CI_COMMIT_SHA
stage: test
script:
- pytest
- alembic upgrade head
- coverage run run.py &
- tm_pid=$!
# wait for 8445 to be open
- while ! nc -z localhost 8445; do echo "."; sleep 2; done
- /root/.local/bin/pyresttest http://localhost:8445 tests/api/test.yaml
- kill -SIGINT $tm_pid
- sleep 2
- coverage report --include "tmeister/*"

push-to-dockerhub:
stage: push-to-dockerhub
Expand Down
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
FROM canopytax/python-base
FROM python:alpine

RUN apk --no-cache add curl-dev && \
export PYCURL_SSL_LIBRARY=openssl && \
RUN apk --no-cache add curl-dev bash

COPY requirements.txt /app/

RUN export PYCURL_SSL_LIBRARY=openssl && \
pip3 install -r requirements.txt --user -U

RUN apk --no-cache add nodejs && \
COPY tmeister/static /app/tmeister/static

RUN apk --no-cache add nodejs git && \
cd /app/tmeister/static && \
npm install && \
npm run build && \
apk del nodejs && \
apk --no-cache del nodejs git && \
rm -rf node_modules spec src bin && \
cd /app

WORKDIR /app

COPY . /app


EXPOSE 8445

0 comments on commit 7ab83f6

Please sign in to comment.