diff --git a/.env b/.env index a0f2bb5..5ec8276 100644 --- a/.env +++ b/.env @@ -1,3 +1,12 @@ +# Container names +NGINX_CONTAINER_NAME=nginx +REDIS_CONTAINER_NAME=redis +POSTGRESQL_CONTAINER_NAME=db +SOLR_CONTAINER_NAME=solr +DATAPUSHER_CONTAINER_NAME=datapusher +CKAN_CONTAINER_NAME=ckan +WORKER_CONTAINER_NAME=ckan-worker + # CKAN databases POSTGRES_USER=ckan POSTGRES_PASSWORD=ckan @@ -29,7 +38,7 @@ CKAN_SMTP_MAIL_FROM=ckan@localhost TZ=UTC # Solr -SOLR_VERSION=6.6.6 +SOLR_IMAGE_VERSION=2.9-solr8 CKAN_SOLR_URL=http://solr:8983/solr/ckan TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan diff --git a/datapusher/Dockerfile b/datapusher/Dockerfile index c345eb1..058ca5d 100755 --- a/datapusher/Dockerfile +++ b/datapusher/Dockerfile @@ -1,7 +1,8 @@ FROM alpine:3.13 +ARG DATAPUSHER_VERSION ENV APP_DIR=/srv/app -ENV GIT_BRANCH 0.0.17 +ENV GIT_BRANCH ${DATAPUSHER_VERSION} ENV GIT_URL https://github.com/ckan/datapusher.git ENV JOB_CONFIG ${APP_DIR}/datapusher_settings.py diff --git a/docker-compose.yml b/docker-compose.yml index 26d15ee..c6f3f55 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,16 @@ version: "3" +volumes: + ckan_config: + ckan_home: + ckan_storage: + pg_data: + solr_data: + services: nginx: - container_name: nginx + container_name: ${NGINX_CONTAINER_NAME} build: context: nginx/ dockerfile: Dockerfile @@ -21,48 +28,61 @@ services: # - TZ=${TZ} # env_file: # - .env - # links: - # - db - # - solr - # - redis - # - datapusher + #depends_on: + # db: + # condition: service_healthy + # solr: + # condition: service_healthy + # redis: + # condition: service_healthy # ports: # - "0.0.0.0:${CKAN_PORT}:5000" - # volumes: + #volumes: + # - ckan_config:/etc/ckan + # - ckan_home:/usr/lib/ckan # - ckan_storage:/var/lib/ckan + #restart: unless-stopped + #healthcheck: + # test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] - #datapusher: - # container_name: datapusher - # image: kowhai/datapusher:${DATAPUSHER_VERSION} - # ports: - # - "8800:8800" + datapusher: + container_name: ${DATAPUSHER_CONTAINER_NAME} + build: + context: datapusher/ + args: + - DATAPUSHER_VERSION=${DATAPUSHER_VERSION} + ports: + - "8800:8800" + restart: unless-stopped - #db: - # container_name: db - # build: - # context: postgresql/ - # args: - # - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} - # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - # environment: - # - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} - # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - # - PGDATA=/var/lib/postgresql/data/db - # volumes: - # - pg_data:/var/lib/postgresql/data + db: + container_name: ${POSTGRESQL_CONTAINER_NAME} + build: + context: postgresql/ + args: + - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + environment: + - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - PGDATA=/var/lib/postgresql/data/db + volumes: + - pg_data:/var/lib/postgresql/data + restart: unless-stopped + healthcheck: + test: ["CMD", "pg_isready", "-U", "ckan"] - #solr: - # container_name: solr - # build: - # context: solr/ - # volumes: - # - solr_data:/opt/solr/server/solr/ckan/data/index + solr: + container_name: ${SOLR_CONTAINER_NAME} + image: ckan/ckan-solr:${SOLR_IMAGE_VERSION} + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8983/solr/"] redis: - container_name: redis + container_name: ${REDIS_CONTAINER_NAME} image: redis:${REDIS_VERSION} + restart: unless-stopped + healthcheck: + test: ["CMD", "redis-cli", "-e", "QUIT"] -#volumes: -# ckan_storage: -# pg_data: -# solr_data: