wip
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/manual/woodpecker Pipeline was successful Details

This commit is contained in:
Paul J Stevens 2024-02-08 21:44:51 +01:00
parent 43461e90c7
commit ecfed33614
5 changed files with 57 additions and 3 deletions

View File

@ -9,4 +9,4 @@ ENV SETUPTOOLS_SCM_PRETEND_VERSION=${PROJECT_VERSION}
RUN pdm install
RUN apt-get remove -y gcc libpq-dev && apt-get autoremove -y
ENTRYPOINT ["pdm","run","trytond", "-c", "/app/etc/docker.ini", "-v", "-d", "bij1"]
CMD pdm run gunicorn --config=/app/etc/gunicorn.conf.py

0
deploy/env Normal file
View File

33
deploy/stack.yml Normal file
View File

@ -0,0 +1,33 @@
version: '3'
services:
erp:
image: registry.bij1.org/bij1.erp:${DOCKER_TAG}
command: pdm run gunicorn --config=/app/etc/trytond.conf.py
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- ./env
ports:
- "8000:8000"
deploy:
replicas: 1
restart_policy:
condition: on-failure
logging:
driver: journald
api:
image: registry.bij1.org/bij1.erp:${DOCKER_TAG}
command: pdm run gunicorn bij1.api.main:app -w 4 -k uvicorn.workers.UvicornWorker --port 5000
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- ./env
ports:
- "5000:5000"
deploy:
replicas: 1
restart_policy:
condition: on-failure
logging:
driver: journald

15
etc/trytond.conf.py Normal file
View File

@ -0,0 +1,15 @@
import os
import multiprocessing
TRYTOND_CONFIG = os.environ.get("TRYTOND_CONFIG", "/app/etc/docker.ini")
TRYTOND_DATABASE_NAMES = os.environ.get("TRYTOND_DATABASE_NAMES", "bij1")
raw_env = [
f"TRYTOND_CONFIG={TRYTOND_CONFIG}",
f"TRYTOND_DATABASE_NAMES={TRYTOND_DATABASE_NAMES}",
]
bind = "127.0.0.1:8000"
workers = multiprocessing.cpu_count() * 2 + 1
wsgi_app = "trytond.application:app"

View File

@ -44,16 +44,22 @@ dev = [
"pytest-trytond>=0.1.0",
]
[tool.pytest.ini_options]
[tool.pytest.ini_options]
testpaths = "tests/"
[tool.setuptools_scm]
[tool.setuptools_scm]
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
[tool.isort]
profile = "black"
[tool.ruff]
src = ["src", "tests", "etc"]
target-version = "py311"
extend-ignore = ["F403", "F405", "E402"]
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"