Skip to content

Commit caa74bc

Browse files
author
Kence Anderson
committed
Merge pull request #1 from Syncano/master
Merge 010616
2 parents 0cfde20 + 107529b commit caa74bc

File tree

5 files changed

+47
-14
lines changed

5 files changed

+47
-14
lines changed

.dockercfg.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"<REGISTRY>":{"auth":"<AUTH>","email":"<EMAIL>"}}

Dockerfile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
FROM python:2.7
2-
1+
FROM ubuntu:trusty
32
MAINTAINER "Syncano DevOps Team" <devops@syncano.com>
43

5-
ENV LAST_REFRESHED 2015-12-11
4+
ENV LAST_REFRESHED 2015-12-17
5+
ENV export SYNCANO_APIROOT='https://api.syncano.io/'
6+
7+
COPY requirements.txt /tmp/requirements.txt
8+
COPY external_requirements.txt /tmp/external_requirements.txt
69

710
RUN apt-get update && apt-get install -qqy \
811
git \
912
libffi-dev \
1013
libssl-dev \
11-
libjpeg-dev
12-
13-
ENV export SYNCANO_APIROOT='https://api.syncano.io/'
14-
15-
COPY requirements.txt /tmp/requirements.txt
16-
COPY external_requirements.txt /tmp/external_requirements.txt
17-
RUN pip install -r /tmp/requirements.txt \
14+
libjpeg-dev \
15+
python-dev \
16+
wget \
17+
&& wget https://bootstrap.pypa.io/get-pip.py \
18+
&& python get-pip.py \
19+
&& pip install --upgrade pip \
20+
&& pip install -r /tmp/requirements.txt \
1821
&& pip install -r /tmp/external_requirements.txt
1922

20-
RUN chmod 1777 /tmp
2123
# create a special user to run code
2224
# user without root privileges greatly improves security
23-
RUN groupadd -r syncano && useradd -r -g syncano syncano
24-
USER syncano
25+
RUN groupadd -r syncano \
26+
&& useradd -r -g syncano syncano
27+
RUN chmod 1777 /tmp
2528

29+
USER syncano
30+
CMD ["python"]

circle.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
machine:
2+
services:
3+
- docker
4+
5+
dependencies:
6+
override:
7+
- sed -i 's/CMD/#CMD/g' Dockerfile
8+
- docker build -t quay.io/syncano/python-codebox .
9+
10+
test:
11+
override:
12+
- docker run -it -v `pwd`/test.py:/tmp/test.py quay.io/syncano/python-codebox python /tmp/test.py
13+
14+
deployment:
15+
production:
16+
branch:
17+
- master
18+
commands:
19+
- sed -e "s|<REGISTRY>|$DOCKER_REGISTRY|g" -e "s|<EMAIL>|$DOCKER_EMAIL|g" -e "s|<AUTH>|$DOCKER_AUTH|g" < .dockercfg.template > ~/.dockercfg
20+
- sed -i 's/#CMD/CMD/g' Dockerfile
21+
- docker build -t quay.io/syncano/python-codebox .
22+
- docker push quay.io/syncano/python-codebox

external_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-i https://pypi.fury.io/Nx-poGuiakLbsCzaLwNm/aexol
2-
aexol==0.1
2+
aexol==0.1.2
33

test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if __name__ == '__main__':
2+
import pkgutil
3+
modules = (name for _, name, is_pkg in pkgutil.iter_modules()
4+
if is_pkg)
5+
map(__import__, modules)

0 commit comments

Comments
 (0)