Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker support #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.7-alpine

RUN apk add --no-cache gcc musl-dev

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install -r requirements.txt --force-reinstall --no-cache-dir

COPY ./entrypoint.sh .

COPY . .

RUN ["chmod", "+x", "./entrypoint.sh"]

RUN python setup.py install

CMD [ "./entrypoint.sh" ]
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Print help
-t TIMEOUT, --timeout TIMEOUT
Request timeout

Docker
#######
::
docker build -t pyebox .
::
docker run -e PYEBOX_MYACCOUNT=*** -e PYEBOX_MYPASSWORD=*** pyebox

Dev env
#######

Expand Down
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

# Check user and password
if [ -z "$PYEBOX_MYACCOUNT" ] || [ -z "$PYEBOX_MYPASSWORD" ]
then
echo 'Error: No user or password. Set both environnement variables PYEBOX_MYACCOUNT and PYEBOX_MYPASSWORD'
exit 1
else
pyebox -u $PYEBOX_MYACCOUNT -p $PYEBOX_MYPASSWORD
fi