Skip to content

Commit

Permalink
Add working example
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed Oct 22, 2024
1 parent 188f6e6 commit 762a8a0
Show file tree
Hide file tree
Showing 58 changed files with 2,686 additions and 2,652 deletions.
14 changes: 14 additions & 0 deletions example/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__pycache__
.mypy_cache
.pytest_cache
.ruff_cache
.history
.vscode

.coverage

htmlcov
coverage.xml
report.xml

.DS_Store
10 changes: 10 additions & 0 deletions example/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_INIT_CLIENT_ID=root
APP_INIT_CLIENT_SECRET=secret
APP_INIT_URL=http://host.docker.internal:8080

APP_ID=file-uploader
APP_SECRET=secret
APP_URL=http://host.docker.internal:8081
APP_PORT=8081
AIO_PORT=8081
AIO_HOST=0.0.0.0
1 change: 1 addition & 0 deletions example/.env.tests.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AIDBOX_LICENSE_TEST=
31 changes: 0 additions & 31 deletions example/.env.tpl

This file was deleted.

30 changes: 15 additions & 15 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
config/jwtRS256.key
config/jwtRS256.key.pub
beta
.cpcache
.volumes
app.log
.idea/
pom.xml
ui/*.iml
*.iml
__pycache__
.mypy_cache
.pytest_cache
.ruff_cache
.history
.vscode

.env
__pycache__/
.DS_Store
venv/
env/
htmlcov/
.env.tests.local

.coverage

htmlcov
coverage.xml
report.xml

.DS_Store
26 changes: 17 additions & 9 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM python:3.10
RUN mkdir /app
FROM python:3.12-slim

RUN addgroup --gid 1000 dockeruser
RUN adduser --disabled-login --uid 1000 --gid 1000 dockeruser
RUN mkdir -p /app/
RUN chown -R dockeruser:dockeruser /app/

RUN pip install poetry

USER dockeruser

WORKDIR /app

RUN pip install pipenv safety
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install

COPY Pipfile .
COPY Pipfile.lock .
RUN pipenv install
RUN pipenv check
COPY . .

CMD ["pipenv", "run", "gunicorn", "main:create_app", "--worker-class", "aiohttp.worker.GunicornWebWorker", "-b", "0.0.0.0:8081"]
EXPOSE 8081
RUN poetry run mypy

CMD ["poetry", "run", "gunicorn", "main:create_gunicorn_app", "--worker-class", "aiohttp.worker.GunicornWebWorker", "-b", "0.0.0.0:8081"]
21 changes: 21 additions & 0 deletions example/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 beda.software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions example/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build-test:
docker compose -f compose.test-env.yaml build

stop-test:
docker compose -f compose.test-env.yaml stop

down-test:
docker compose -f compose.test-env.yaml down
53 changes: 0 additions & 53 deletions example/Pipfile

This file was deleted.

Loading

0 comments on commit 762a8a0

Please sign in to comment.