Apply config changes for CSP file uploads.

This applies configuration changes for the Flask app and adds changes to
the Dockerfile so that the build can make a CSP-specific JS bundle. It
adds `write_dotenv` script that creates the appropriate `.env` file for
the `parcel` bundler depending on how the `CSP` environment variable is
set.

- Configure K8s environment variables for Flask CSP usage
- Supply default CSP config setting to Flask app
- Declare the CSP arg in the Dockerfile
- Supply extra Docker build args to CD
- Fix top-level reference to boto3 in file_upload module
- Add back missing sample NGINX config for docker-compose build
This commit is contained in:
dandds
2019-08-08 10:08:15 -04:00
parent a941cca5e6
commit 485f578c78
8 changed files with 48 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
FROM python:3.7.3-alpine3.9 AS builder
ARG CSP
RUN mkdir -p /install/.venv
WORKDIR /install
@@ -32,10 +34,11 @@ RUN apk update && \
COPY . .
# Install app dependencies
RUN pip install pipenv uwsgi && \
RUN ./script/write_dotenv && \
pip install pipenv uwsgi && \
PIPENV_VENV_IN_PROJECT=1 pipenv install && \
yarn install && \
cp -r ./node_modules/uswds/src/fonts ./static/ && \
cp -rf ./node_modules/uswds/src/fonts ./static/ && \
yarn build
## NEW IMAGE