mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
bugsink-server-unified: run in Docker
This commit is contained in:
@@ -27,6 +27,8 @@ RUN --mount=type=cache,target=/var/cache/buildkit/pip \
|
||||
|
||||
COPY bugsink_conf.py .
|
||||
|
||||
RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"]
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["gunicorn", "--bind=0.0.0.0:9000", "--access-logfile", "-", "bugsink.wsgi"]
|
||||
CMD [ "bugsink-server-unified", "gunicorn", "--bind=0.0.0.0:9000", "--workers=10", "--access-logfile", "-", "bugsink.wsgi", "UNIFIED_WITH", "bugsink-runsnappea"]
|
||||
|
||||
58
bugsink/conf_templates/docker.py.template
Normal file
58
bugsink/conf_templates/docker.py.template
Normal file
@@ -0,0 +1,58 @@
|
||||
from bugsink.settings.default import * # noqa
|
||||
from bugsink.settings.default import DATABASES
|
||||
|
||||
DEBUG = True
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = "q47jh!sj-y4+6i4_fj*tyj1ej2&wl6st+@^ycgs7kl81dg^33h"
|
||||
|
||||
# Alternatively, pass the SECRET_KEY as an environment variable. (although that has security implications too!)
|
||||
# i.e. those may leak in shared server setups.
|
||||
#
|
||||
# SECRET_KEY = os.environ["SECRET_KEY"] # use dictionary lookup rather than .getenv to ensure the variable is set.
|
||||
|
||||
|
||||
ALLOWED_HOSTS = ["bugsink"]
|
||||
|
||||
|
||||
# The time-zone here is the default for display purposes (when no project/user configuration is used).
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-TIME_ZONE
|
||||
TIME_ZONE = 'Europe/Amsterdam'
|
||||
|
||||
|
||||
# See TODO in the docs
|
||||
SNAPPEA = {
|
||||
"TASK_ALWAYS_EAGER": False,
|
||||
"NUM_WORKERS": 2,
|
||||
}
|
||||
|
||||
|
||||
DATABASES['default'] = {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'bugsink',
|
||||
"USER": "root",
|
||||
"PASSWORD": "bugsink",
|
||||
"HOST": "mysql_container",
|
||||
}
|
||||
|
||||
|
||||
# EMAIL_HOST = ...
|
||||
# EMAIL_HOST_USER = ...
|
||||
# EMAIL_HOST_PASSWORD = ...
|
||||
# EMAIL_PORT = ...
|
||||
# EMAIL_USE_TLS = ...
|
||||
|
||||
SERVER_EMAIL = DEFAULT_FROM_EMAIL = "Bugsink <bugsink@example.org>"
|
||||
|
||||
BUGSINK = {
|
||||
# See TODO in the docs
|
||||
"DIGEST_IMMEDIATELY": False,
|
||||
|
||||
# "MAX_EVENT_SIZE": _MEBIBYTE,
|
||||
# "MAX_EVENT_COMPRESSED_SIZE": 200 * _KIBIBYTE,
|
||||
# "MAX_ENVELOPE_SIZE": 100 * _MEBIBYTE,
|
||||
# "MAX_ENVELOPE_COMPRESSED_SIZE": 20 * _MEBIBYTE,
|
||||
|
||||
# "BASE_URL": "http://bugsink:9000", # no trailing slash
|
||||
# "SITE_TITLE": "Bugsink", # you can customize this as e.g. "My Bugsink" or "Bugsink for My Company"
|
||||
}
|
||||
@@ -66,5 +66,9 @@ class ParentProcess:
|
||||
child.send_signal(signum)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
ParentProcess()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -9,12 +9,12 @@ echo "Building docker image with wheel file: $WHEEL_FILE"
|
||||
# if this a non-dev version, we tag the image with the full version number, major.minor, major, and latest
|
||||
# otherwise no tags are added
|
||||
|
||||
TAGS=""
|
||||
if [[ $WHEEL_FILE == *"dev"* ]]; then
|
||||
echo "This is a dev version, no tags will be added"
|
||||
TAGS="-t bugsink:dev"
|
||||
else
|
||||
VERSION=$(echo $WHEEL_FILE | cut -d'-' -f2)
|
||||
TAGS="-t bugsink:$VERSION -t bugsink:$(echo $VERSION | awk -F. '{print $1"."$2}') -t bugsink:$(echo $VERSION | awk -F. '{print $1}') -t bugsink:latest"
|
||||
TAGS="-t bugsink:$VERSION -t bugsink:$(echo $VERSION | awk -F. '{print $1"."$2}') -t bugsink:$(echo $VERSION | awk -F. '{print $1}') -t bugsink:latest -t bugsink"
|
||||
echo "This is a non-dev version, tags will be added: $TAGS"
|
||||
fi
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ bugsink-show-version = "bugsink.scripts.show_version:main"
|
||||
bugsink-manage = "bugsink.scripts.manage:main"
|
||||
bugsink-create-conf = "bugsink.scripts.create_conf:main"
|
||||
bugsink-runsnappea = "bugsink.scripts.runsnappea:main"
|
||||
bugsink-server-unified = "bugsink.scripts.server_unified:main"
|
||||
|
||||
[tool.setuptools]
|
||||
include-package-data = true # this is the default, but explicit is better than implicit
|
||||
|
||||
Reference in New Issue
Block a user