fedspendingtransparency/usaspending-api

View on GitHub
Dockerfile.testing

Summary

Maintainability
Test Coverage
# Dockerfile for usaspending-test image

# If any changes are made to the usaspending-backend image (Dockerfile) then this image needs to be rebuilt to stay in sync.

# If you do not already have the `usaspending-backend` image locally you can build it by running:
#       docker compose --profile usaspending build
# in the parent usaspending-api directory.

FROM usaspending-backend:latest

WORKDIR /usaspending-api

# Install Java for PySpark
RUN yum install -y java-1.8.0-openjdk-devel
RUN export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.382.b05-1.el7_9.x86_64
RUN export PATH=$JAVA_HOME/bin:$PATHv

# Prevent a Pytest RuntimeError where it expects the parent directory to be the name of an installed Django app
# This will cause a RuntimeError because `dockermount` isn't the name of an installed Django app, so we move the files
#   to a `/usaspending-api` parent directory which is the name of an installed Django app.
RUN mv /dockermount/* /usaspending-api/

# Copy .env.template file for config tests
COPY .env.template /usaspending-api/

RUN python3 -m pip install -r requirements/requirements-dev.txt