16 Commits

Author SHA1 Message Date
dandds
7fdfd330b4 Copy the directory name correctly in the Docker build.
The top-level module should be named "atat" inside the Docker container.
Confusingly, the application code is inside "/opt/atat/atst", with the
top-level application module at "/opt/atat/atst/atat". That directory
path is a holdover from when this application was a series of
microservices. Eventually we should truncate it to something sensible
and descriptive.
2020-03-04 14:11:31 -05:00
leigh-mil
c2814416fb Update atst to atat 2020-03-04 11:51:15 -05:00
dandds
1ef0671158 Update CAs in the container.
In order for the app to make > TLS 1.2 connections to Redis, we need to
update the local certificate store in the container.
2020-02-07 12:48:44 -05:00
dandds
49446fdbe9 uWSGI plugin config changes.
uWGI was generating warnings about being unable to find plugin files we
specify. To fix this, I've added uwsgi-python3 to the list of Alpine
packages we install in the container specified the plugins directory in
the uWSGI config. The updated uWSGI ConfigMap has been applied to the
staging cluster, which eliminated the warning about the logfile plugin.
The remaining warning about the python3 plugin will be eliminated once
the new container built by this branch is deployed.
2020-01-09 11:36:00 -05:00
dandds
9d282ee82a K8s cronjob for resetting the database on staging.
This K8s CronJob will run the script for resetting the database. It will
only be applied to the staging site.
2019-12-17 13:19:40 -05:00
dandds
241c66f121 Copy reporting fixture into the Dockerfile.
In order for the fixture data to be available in the container at
runtime, we need to copy it into the final stage of the Docker image.
2019-12-11 09:34:06 -05:00
richard-dds
5ca20222fc Run build-prod in CI 2019-11-21 16:42:42 -05:00
richard-dds
8ddd9fab96 Add docker arg for CDN_URL 2019-11-21 16:42:42 -05:00
dandds
253cc29c56 Force removal of existing fonts symlink in Docker build.
For local development, we symlink the USWDS fonts from the npm installed
copy into our static directory. This causes problems for the Docker
build because it is not expecting to find a pre-existing "static/fonts"
directory. This forcibly removes any existing "static/fonts" directory
to fix the issue.
2019-11-07 15:22:16 -05:00
dandds
23c4ba32eb CI/CD uses Docker containers exclusively and removes CircleCI Orbs.
The CircleCI Orbs were useful for getting started, but now that we only
have to deploy to one provider our pipeline should be tailored to
efficiently push to just that environment. This inlines all the relevant
pieces from the Orbs we were relying on as bash/sh commands instead.

This builds the Docker images upfront. Since we have a multi-stage
Dockerfile, it builds the first stage as a separate image and then
proceeds to build the complete image. This is done so that the first
stage (called "builder") can be used for testing. It retains executables
like pipenv that we need to install development dependencies needed for
tests.

Other notes:
- CircleCI does not persist Docker images between jobs. As a
  work-around, we use the CircleCI caching mechanism to create a named
  cache with *.tar copies of the images. Subsequent jobs use the cache
  and load the images.
- Both the test and integration-tests jobs need to make minor
  modifications to the container to run correctly. The test job needs to
  install the development Python dependencies, and the integration-tests
  job needs to rebuild the JS bundle so that it uses the mock uploader
  (the container is build to use the Azure uploader by default).
- The test and integration-tests jobs run in parallel.
- This adjusts the Dockerfile so that the TZ environment variable is set
  for both stages of the build.
2019-10-30 12:04:21 -04:00
dandds
e6385cda2d Include celery worker script in docker image. 2019-08-29 13:44:39 -04:00
dandds
4baf397be2 Use pipenv sync command in Dockerfile.
`sync` is recommended for deployments. It installs exactly what's in
the Pipfile.lock and does not try to update the lockfile.

https://docs.pipenv.org/en/latest/advanced/#using-pipenv-for-deployments
2019-08-14 09:46:42 -04:00
dandds
485f578c78 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
2019-08-09 08:05:20 -04:00
dandds
44141c002d Fix up sync-crls script and add to Dockerfile.
- Fix some python formatting and import issues
- Fix dockerfile to include sync-crls script
- Adjust sync-crls script to use paths and CLI tools available in the
  Docker container
2019-08-06 11:31:19 -04:00
dandds
f3e032fc03 Finalize CD config and add k8s job for migrations.
Add CircleCI config for both CSPs to:
- build the Docker image and push it to the registry
- run a short-lived k8s job to apply migrations and see data
- update the images for the Flask pods and rq worker pods
2019-07-31 11:58:43 -04:00
dandds
ef8fd2fa41 Put Dockerfile in repo root for ease of use.
Most build tools (i.e., the CircleCI Orbs) expect a Dockerfile in the
repo root. Rather than have to configure an exception everywhere, put it
where most people/tools expect it to be.
2019-07-14 16:00:09 -04:00