From 5f7c18bd187c649048de53c75a2fac56a4c6a5da Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 12 Mar 2020 20:14:46 +0300 Subject: [PATCH] feat(config): Mount config as a volume to Sentry (#407) This follows the best-practice of mounting the config folder as a volume and removes the need to rebuild sentry images for config changes. Partially addresses #314. --- docker-compose.yml | 2 ++ sentry/.dockerignore | 5 +++++ sentry/Dockerfile | 11 ----------- 3 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 sentry/.dockerignore diff --git a/docker-compose.yml b/docker-compose.yml index 19f25eb..ccf1346 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,9 +19,11 @@ x-sentry-defaults: &sentry_defaults - symbolicator - kafka environment: + SENTRY_CONF: '/etc/sentry' SNUBA: 'http://snuba-api:1218' volumes: - 'sentry-data:/data' + - './sentry:/etc/sentry' x-snuba-defaults: &snuba_defaults << : *restart_policy depends_on: diff --git a/sentry/.dockerignore b/sentry/.dockerignore new file mode 100644 index 0000000..693a7e0 --- /dev/null +++ b/sentry/.dockerignore @@ -0,0 +1,5 @@ +# Ignore everything +* + +# Only allow requirements.txt +!/requirements.txt diff --git a/sentry/Dockerfile b/sentry/Dockerfile index 032f340..bf8f198 100644 --- a/sentry/Dockerfile +++ b/sentry/Dockerfile @@ -1,18 +1,7 @@ ARG SENTRY_IMAGE FROM ${SENTRY_IMAGE:-getsentry/sentry:latest} -WORKDIR /usr/src/sentry - -# Add WORKDIR to PYTHONPATH so local python files don't need to be installed -ENV PYTHONPATH /usr/src/sentry COPY . /usr/src/sentry # Hook for installing additional plugins RUN if [ -s requirements.txt ]; then pip install -r requirements.txt; fi - -# Hook for installing a local app as an addon -RUN if [ -s setup.py ]; then pip install -e .; fi - -# Hook for staging in custom configs -RUN if [ -s sentry.conf.py ]; then cp sentry.conf.py $SENTRY_CONF/; fi \ - && if [ -s config.yml ]; then cp config.yml $SENTRY_CONF/; fi