Skip to content

Commit

Permalink
Merge pull request #139 from GSA/feature/inventory-next-new-relic
Browse files Browse the repository at this point in the history
Feature/inventory next new relic
  • Loading branch information
Preston authored Oct 27, 2020
2 parents 4a1153b + a5db3e0 commit 5c41af5
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG REQUIREMENTS_FILE=requirements.txt
ARG PYTHON_VERSION=2.7.17

ENV CKAN_HOME /usr/lib/ckan
ENV CKAN_CONFIG /etc/ckan/
ENV CKAN_CONFIG /etc/ckan
ENV CKAN_ENV docker

WORKDIR /opt/inventory-app
Expand Down Expand Up @@ -54,4 +54,6 @@ RUN $CKAN_HOME/bin/pip install -r /tmp/requirements.txt
COPY entrypoint-docker.sh /
ENTRYPOINT ["/entrypoint-docker.sh"]

COPY config/server_start.sh $CKAN_CONFIG/

CMD ["/bin/bash"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test:
docker-compose -f docker-compose.yml -f docker-compose.test.yml -f docker-compose.seed.yml up --abort-on-container-exit test

up:
docker-compose up
docker-compose up -d

up-with-data:
docker-compose -f docker-compose.yml -f docker-compose.seed.yml build
Expand Down
10 changes: 10 additions & 0 deletions config/server_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

DIR="$(dirname "${BASH_SOURCE[0]}")"

if test -f "$DIR/.env"; then
set -o allexport; source $DIR/.env; set +o allexport
fi

# Run web application
newrelic-admin run-program gunicorn --worker-class gevent --paste $CKAN_INI "$@"
6 changes: 1 addition & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ services:
- datastore
- db
- solr
environment:
DB_CKAN_HOST: db
DB_CKAN_USER: ckan
DB_CKAN_PASSWORD: pass
DB_CKAN_DB: ckan
ports:
- "5000:5000"
env_file: env_file
volumes:
- ckan:/usr/lib/ckan
- ./config:/etc/ckan
Expand Down
15 changes: 15 additions & 0 deletions env_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# New Relic
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_APP_NAME=inventory-next
NEW_RELIC_MONITOR_MODE=false
NEW_RELIC_LOG=/var/log/new_relic.log
NEW_RELIC_LOG_LEVEL=info
NEW_RELIC_HOST=gov-collector.newrelic.com


# CKAN
DB_CKAN_HOST=db
DB_CKAN_USER=ckan
DB_CKAN_PASSWORD=pass
DB_CKAN_DB=ckan
CKAN_INI=/etc/ckan/production.ini
1 change: 1 addition & 0 deletions requirements-freeze.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Mako==1.0.7
Markdown==2.6.7
MarkupSafe==1.0
mock==1.0.1
newrelic==5.20.1.150
nose==1.3.7
ofs==0.4.2
Pairtree===0.7.1-T
Expand Down
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-e git+https://github.com/ckan/[email protected]#egg=ckan
-e git+https://github.com/GSA/ckanext-googleanalyticsbasic#egg=ckanext-googleanalyticsbasic
-e git+https://github.com/GSA/USMetadata.git@ckan-2-8#egg=ckanext-usmetadata
-e git+https://github.com/GSA/ckanext-datajson.git@master#egg=ckanext-datajson
-e git+https://github.com/ckan/[email protected]#egg=ckan
-e git+https://github.com/GSA/ckanext-googleanalyticsbasic#egg=ckanext-googleanalyticsbasic
-e git+https://github.com/GSA/USMetadata.git@ckan-2-8#egg=ckanext-usmetadata
-e git+https://github.com/GSA/ckanext-datajson.git@master#egg=ckanext-datajson
-e git+https://github.com/GSA/ckanext-saml2.git@max#egg=ckanext-saml2
-e git+https://github.com/GSA/webob.git@ckan-patch#egg=webob
ckanext-dcat-usmetadata==0.1.11
Expand Down Expand Up @@ -31,6 +31,7 @@ Mako==1.0.7 # via pylons
Markdown==2.6.7
MarkupSafe==1.0 # via jinja2, mako, webhelpers
mock==1.0.1 # needed for usmetadata
newrelic==5.20.1.150
nose==1.3.7 # via pylons
ofs==0.4.2
Pairtree==0.7.1-T
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ if [ "${1-}" = "seed" ]; then
fi

echo starting ckan...
exec $CKAN_HOME/bin/gunicorn --paste /etc/ckan/production.ini -b 0.0.0.0:5000
exec $CKAN_CONFIG/server_start.sh --paste /etc/ckan/production.ini -b 0.0.0.0:5000

0 comments on commit 5c41af5

Please sign in to comment.