Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 67ff6c6

Browse files
authored
Dockerfile (#119)
* added dockerfile * removed unneeded files * update to python 3.11, added github action to build docker image * revert api change * mount .config and ensure n26 folder exists * added comments
1 parent 974126b commit 67ff6c6

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

.github/workflows/docker-latest.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Docker Image latest
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
9+
dockerhub:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Build the Docker image
14+
run: docker build . --file Dockerfile --tag femueller/python-n26:latest

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Docker image for n26
2+
3+
# dont use alpine for python builds: https://pythonspeed.com/articles/alpine-docker-python/
4+
FROM python:3.11-slim-buster
5+
6+
WORKDIR /app
7+
8+
COPY . .
9+
10+
RUN apt-get update \
11+
&& apt-get -y install sudo python3-pip \
12+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
13+
RUN pip install --upgrade pip;\
14+
pip install pipenv;\
15+
PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy;\
16+
pip install .
17+
18+
ENTRYPOINT [ "n26" ]
19+
CMD [ "-h" ]

Pipfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ mock = "*"
2020
flake8 = "*"
2121

2222
[requires]
23-
python_version = "3.10"
23+
python_version = "3.11"

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ layout you can use the global `-json` parameter:
116116
}
117117
```
118118

119+
### Docker
120+
121+
```shell
122+
# ensure the n26 folder exists
123+
mkdir ~/.config/n26
124+
# mount the config and launch the command
125+
sudo docker run -it --rm \
126+
-v "/home/markus/.config/n26.yaml:/app/n26.yaml" \
127+
-v "/home/markus/.config/n26:/.config/n26" \
128+
-u 1000:1000 \
129+
femueller/python-n26
130+
```
131+
119132
### API example
120133

121134
```python
@@ -141,6 +154,8 @@ api_client = Api(conf)
141154
print(api_client.get_balance())
142155
```
143156

157+
158+
144159
## Contribute
145160

146161
If there are any issues, bugs or missing API endpoints, feel free to contribute by forking the project and creating a Pull-Request.

example.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from n26 import api
2+
3+
if __name__ == '__main__':
4+
API_CLIENT = api.Api()

0 commit comments

Comments
 (0)