https://docs.docker.com/engine/reference/builder/ https://docs.docker.com/compose/compose-file/
Current we have two compose files that define different deployment styles; Develop using docker-compoes.dev.yaml
and production using docker-compose.yaml
.
These are the starting point for defining our deployments. These files specify which DockerFile
s and .env
files are used. The DockerFile
s will specify what other start up scripts are run.
Each service has it's own directory in which it's configured.
Solr doesn't have a directory since we use the provided image.
Our custom configuration is defined in ckan/
. This is where we define the addition and changes we want made
to the base image.
Theckan-base/
and ckan-dev/
directories hold source code for the base builds from OKFN.
OKFN hosts images built from these on Docker registry.
Changes to these directories are pulled from the OKFN remote.
Any changes made to these directories should be done on a separate branch intended for a pull request the remote.
When we build our CKAN
images the are built on top of the respective prebuilt CKAN
image from the Docker repository.
Scripts copied to /docker-entrypoint.d/
will be run, in alphabetical order, when the container starts.
docker-entrypoint.d
- copied when using Dockerfile
docker-entrypoint.d.dev
- copied when using Dockerfile.dev
fixtures
- dumps of data used to prepopulate the database in development builds
patches
- patches to apply to the CKAN source code installed on the image. (
see README.md for me information)
Docker configuration based on https://github.com/dathere/datapusher-plus-docker
Not used in production. Defines build for postgres db. Has startup scripts to set up db for CKAN and Datapusher+.
Uses this prebuilt SOLR image made for CKAN by CKAN: https://registry.hub.docker.com/r/ckan/ckan-solr.
# all instances
docker compose up --build -d
# all instances but for the dev setup
docker compose up -f docker-compose.dev.yaml --build -d
# a single instance
docker compose up --build -d <service_name>
docker ps
Start a bash session inside the container created for the ckan session (happens to be named 'ckan' as well)
docker exec -it ckan bash # can also use 'docker ps' to list all to find a container ID. Ours our specified in our docker-compose file.
docker exec -it ckan 'your arbitrary command here'
Clone https://github.com/WPRDC/ckanext-wprdctheme into the src
directory.
Deploying using docker-compose.dev.yaml
, will require this to be done as it looks for our theme there.
Any changes made to our theme will automatically be applied when using the dev deployment.
- Commit your changes to the
main
branch of the theme repo - Rebuild and redeploy (
... --build -d ckan
) theckan
service on the production server. Rebuilding should require it to pull in the latest version of the theme form github. - If the changes don't show up, try first rebuilding it without using the docker cache and then deploying it.
docker compose build --no-cache ckan
docker compose up -d ckan