Skip to content

Commit 762a8a0

Browse files
committed
Add working example
1 parent 188f6e6 commit 762a8a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2686
-2652
lines changed

example/.dockerignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
__pycache__
2+
.mypy_cache
3+
.pytest_cache
4+
.ruff_cache
5+
.history
6+
.vscode
7+
8+
.coverage
9+
10+
htmlcov
11+
coverage.xml
12+
report.xml
13+
14+
.DS_Store

example/.env.example

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
APP_INIT_CLIENT_ID=root
2+
APP_INIT_CLIENT_SECRET=secret
3+
APP_INIT_URL=http://host.docker.internal:8080
4+
5+
APP_ID=file-uploader
6+
APP_SECRET=secret
7+
APP_URL=http://host.docker.internal:8081
8+
APP_PORT=8081
9+
AIO_PORT=8081
10+
AIO_HOST=0.0.0.0

example/.env.tests.local.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AIDBOX_LICENSE_TEST=

example/.env.tpl

-31
This file was deleted.

example/.gitignore

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
config/jwtRS256.key
2-
config/jwtRS256.key.pub
3-
beta
4-
.cpcache
5-
.volumes
6-
app.log
7-
.idea/
8-
pom.xml
9-
ui/*.iml
10-
*.iml
1+
__pycache__
2+
.mypy_cache
3+
.pytest_cache
4+
.ruff_cache
5+
.history
6+
.vscode
7+
118
.env
12-
__pycache__/
13-
.DS_Store
14-
venv/
15-
env/
16-
htmlcov/
9+
.env.tests.local
10+
1711
.coverage
12+
13+
htmlcov
14+
coverage.xml
15+
report.xml
16+
17+
.DS_Store

example/Dockerfile

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
FROM python:3.10
2-
RUN mkdir /app
1+
FROM python:3.12-slim
2+
3+
RUN addgroup --gid 1000 dockeruser
4+
RUN adduser --disabled-login --uid 1000 --gid 1000 dockeruser
5+
RUN mkdir -p /app/
6+
RUN chown -R dockeruser:dockeruser /app/
7+
8+
RUN pip install poetry
9+
10+
USER dockeruser
11+
312
WORKDIR /app
413

5-
RUN pip install pipenv safety
14+
COPY pyproject.toml .
15+
COPY poetry.lock .
16+
RUN poetry install
617

7-
COPY Pipfile .
8-
COPY Pipfile.lock .
9-
RUN pipenv install
10-
RUN pipenv check
1118
COPY . .
1219

13-
CMD ["pipenv", "run", "gunicorn", "main:create_app", "--worker-class", "aiohttp.worker.GunicornWebWorker", "-b", "0.0.0.0:8081"]
14-
EXPOSE 8081
20+
RUN poetry run mypy
21+
22+
CMD ["poetry", "run", "gunicorn", "main:create_gunicorn_app", "--worker-class", "aiohttp.worker.GunicornWebWorker", "-b", "0.0.0.0:8081"]

example/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 beda.software
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

example/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build-test:
2+
docker compose -f compose.test-env.yaml build
3+
4+
stop-test:
5+
docker compose -f compose.test-env.yaml stop
6+
7+
down-test:
8+
docker compose -f compose.test-env.yaml down

example/Pipfile

-53
This file was deleted.

0 commit comments

Comments
 (0)