Skip to content

Commit

Permalink
Initial addition of the configuration files for Dockerization of the …
Browse files Browse the repository at this point in the history
…PDS DOI Service
  • Loading branch information
Scott Collins committed Apr 13, 2021
1 parent 870c83e commit 502692f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pds_doi_service.ini
doi.db
doi_temp.db
transaction_history/
**/test*
**/.DS_Store
**/__pycache__
**/.pytest_cache
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.7-slim

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/

RUN pip3 install --no-cache-dir -r requirements.txt

COPY ./pds_doi_service /usr/src/app/pds_doi_service

EXPOSE 8080

ENTRYPOINT ["python3"]

CMD ["-m", "pds_doi_service.api"]
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.7"

services:
pds-doi-api:
image: pds-doi-service:latest
ports:
- 8080:8080
working_dir: /usr/src/app
volumes:
- sqllite-data:/usr/src/data
environment:
# By setting this envvar in the Compose file, it supersedes anything set
# in doi_service.env. This is how we ensure the SQLite file is written to
# the sqllite-data persistent volume.
- OTHER_DB_FILE=/usr/src/data/doi.db
env_file:
- doi_service.env

volumes:
sqllite-data:
35 changes: 35 additions & 0 deletions doi_service.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file is used with docker-compose.yml to specify a number of environment
# variable key/value pairs to add to the DOI Service's environment when
# launching the container via docker compose up.

# The DOI Service prioritizes environment variables over the included INI,
# so this file may be used to inject credentials or any other supported
# options into the DOI Service when in a containerized context.

# The naming convention for expected environment variables follows from the
# format of the INI, where the section name and option name are concatenated
# with an underscore and converted to uppercase, for example:

# OSTI_USER=username -> overrides the "user" option of the [OSTI] INI section.

# If the default values from the bundled INI are desired, do not specify
# environment variables for them here or they will be overridden.

# Also note that Docker performs "no special handling of quotation marks" for
# values. This means that they become part of the value provided to the DOI Service.

# [OSTI]
OSTI_URL=https://www.osti.gov/iad2test/api/records
OSTI_USER=username
OSTI_PASSWORD=secret

# [PDS4_DICTIONARY]
PDS4_DICTIONARY_URL=https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_JSON_1D00.JSON

# [LANDING_PAGES]
LANDING_PAGES_URL=https://pds.nasa.gov/ds-view/pds/view{}.jsp?identifier={}&version={}

# [OTHER]
OTHER_EMAILER_SENDER=[email protected]
OTHER_PDS_REGISTRATION_DOI_TOKEN=10.17189
OTHER_LOGGING_LEVEL=DEBUG

0 comments on commit 502692f

Please sign in to comment.