diff --git a/LICENSE b/LICENSE index b6daedd..312c72f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2024, TextIt +Copyright (c) 2025, TextIt All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the diff --git a/README.md b/README.md index 3ecf344..d5d7fe4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/nyaruka/rapidpro-docker/workflows/CI/badge.svg)](https://github.com/nyaruka/rapidpro-docker/actions?query=workflow%3ACI) -Docker compose for the latest stable release of RapidPro from Nyaruka (9.2.x). +Docker compose for the latest stable release of RapidPro from Nyaruka (10.0.x). Includes: - RapidPro webapp and celery worker ([License](https://github.com/nyaruka/rapidpro/blob/main/LICENSE)) @@ -13,6 +13,7 @@ Includes: - PostgreSQL (postgis) - Elasticsearch - Redis + - DynamoDB local - Minio (S3 emulator) These example containers are for development purposes only and are not suitable for production deployments. diff --git a/docker-compose.yml b/docker-compose.yml index 69038b4..fd34073 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: ports: - 5432:5432 environment: - - POSTGRES_PASSWORD=tembatemba + POSTGRES_PASSWORD: tembatemba healthcheck: test: ["CMD-SHELL", "pg_isready"] interval: 10s @@ -28,10 +28,10 @@ services: ports: - 9200:9200 environment: - - discovery.type=single-node - - xpack.security.enabled=false - - ingest.geoip.downloader.enabled=false - - logger.level=INFO + discovery.type: single-node + xpack.security.enabled: false + ingest.geoip.downloader.enabled: false + logger.level: INFO healthcheck: test: curl -s http://localhost:9200 >/dev/null || exit 1 interval: 10s @@ -49,6 +49,19 @@ services: interval: 5s timeout: 2s + dynamo: + image: amazon/dynamodb-local + command: "-jar DynamoDBLocal.jar -sharedDb -port 6000" + volumes: + - dynamo:/home/dynamodblocal/data + ports: + - 6000:6000 + healthcheck: + test: [ "CMD-SHELL", "curl -v http://dynamo:6000" ] + interval: 10s + timeout: 5s + restart: always + minio: image: bitnami/minio:latest ports: @@ -57,9 +70,9 @@ services: volumes: - minio:/data environment: - - MINIO_ROOT_USER=root - - MINIO_ROOT_PASSWORD=tembatemba - - MINIO_DEFAULT_BUCKETS=temba-attachments,temba-sessions,temba-logs,temba-archives + MINIO_ROOT_USER: root + MINIO_ROOT_PASSWORD: tembatemba + MINIO_DEFAULT_BUCKETS: temba-default,temba-attachments:public,temba-sessions,temba-logs,temba-archives healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] @@ -68,7 +81,7 @@ services: build: context: ./rapidpro/ args: - - RAPIDPRO_TAG=v9.2.5 + - RAPIDPRO_TAG=v10.0.1 command: ["webapp"] depends_on: postgres: @@ -77,12 +90,15 @@ services: condition: service_healthy redis: condition: service_healthy + dynamo: + condition: service_healthy minio: condition: service_healthy ports: - 8000:8000 environment: - - MAILROOM_URL=http://mailroom:8090 + MAILROOM_URL: http://mailroom:8090 + MAILROOM_AUTH_TOKEN: topsecret healthcheck: test: curl -s http://localhost:8000 >/dev/null || exit 1 interval: 15s @@ -95,18 +111,18 @@ services: build: context: ./rapidpro/ args: - - RAPIDPRO_TAG=v9.2.5 + - RAPIDPRO_TAG=v10.0.0 command: ["celery"] depends_on: rapidpro: condition: service_healthy environment: - - MAILROOM_URL=http://mailroom:8090 + MAILROOM_URL: http://mailroom:8090 mailroom: image: nyaruka/mailroom:stable build: - context: https://github.com/nyaruka/mailroom.git#v9.2.2 + context: https://github.com/nyaruka/mailroom.git#v10.0.0 dockerfile: Dockerfile depends_on: rapidpro: @@ -114,26 +130,29 @@ services: ports: - 8090:8090 environment: - - MAILROOM_ADDRESS=0.0.0.0 - - MAILROOM_DB=postgres://temba:temba@postgres:5432/temba?sslmode=disable - - MAILROOM_REDIS=redis://redis:6379/15 - - MAILROOM_ELASTIC=http://elastic:9200 - - MAILROOM_DOMAIN=${MAILROOM_DOMAIN:-host.docker.internal} - - MAILROOM_ATTACHMENT_DOMAIN=${MAILROOM_ATTACHMENT_DOMAIN:-host.docker.internal} - - MAILROOM_DISALLOWED_NETWORKS=6.6.6.6 - - MAILROOM_AWS_ACCESS_KEY_ID=root - - MAILROOM_AWS_SECRET_ACCESS_KEY=tembatemba - - MAILROOM_S3_ENDPOINT=http://minio:9000 - - MAILROOM_S3_SESSIONS_BUCKET=temba-sessions - - MAILROOM_S3_ATTACHMENTS_BUCKET=temba-attachments - - MAILROOM_S3_LOGS_BUCKET=temba-logs - - MAILROOM_S3_FORCE_PATH_STYLE=true - - MAILROOM_LOG_LEVEL=info + MAILROOM_ADDRESS: 0.0.0.0 + MAILROOM_DB: postgres://temba:temba@postgres:5432/temba?sslmode=disable + MAILROOM_REDIS: redis://redis:6379/15 + MAILROOM_ELASTIC: http://elastic:9200 + MAILROOM_DOMAIN: ${MAILROOM_DOMAIN:-host.docker.internal} + MAILROOM_ATTACHMENT_DOMAIN: ${MAILROOM_ATTACHMENT_DOMAIN:-host.docker.internal} + MAILROOM_DISALLOWED_NETWORKS: 6.6.6.6 + MAILROOM_AUTH_TOKEN: topsecret + MAILROOM_COURIER_AUTH_TOKEN: topsecret + MAILROOM_AWS_ACCESS_KEY_ID: root + MAILROOM_AWS_SECRET_ACCESS_KEY: tembatemba + MAILROOM_DYNAMO_ENDPOINT: http://dynamo:6000 + MAILROOM_DYNAMO_TABLE_PREFIX: Temba + MAILROOM_S3_ENDPOINT: http://minio:9000 + MAILROOM_S3_SESSIONS_BUCKET: temba-sessions + MAILROOM_S3_ATTACHMENTS_BUCKET: temba-attachments + MAILROOM_S3_MINIO: true + MAILROOM_LOG_LEVEL: info courier: image: nyaruka/courier:stable build: - context: https://github.com/nyaruka/courier.git#v9.2.1 + context: https://github.com/nyaruka/courier.git#v10.0.0 dockerfile: Dockerfile depends_on: rapidpro: @@ -141,32 +160,34 @@ services: ports: - 8080:8080 environment: - - COURIER_ADDRESS=0.0.0.0 - - COURIER_DB=postgres://temba:temba@postgres:5432/temba?sslmode=disable - - COURIER_REDIS=redis://redis:6379/15 - - COURIER_DOMAIN=${COURIER_DOMAIN:-host.docker.internal} - - COURIER_BASE_URL=${COURIER_BASE_URL:-https://host.docker.internal} - - COURIER_DISALLOWED_NETWORKS=6.6.6.6 - - COURIER_AWS_ACCESS_KEY_ID=root - - COURIER_AWS_SECRET_ACCESS_KEY=tembatemba - - COURIER_S3_ENDPOINT=http://minio:9000 - - COURIER_S3_ATTACHMENTS_BUCKET=temba-attachments - - COURIER_S3_LOGS_BUCKET=temba-logs - - COURIER_S3_FORCE_PATH_STYLE=true - - COURIER_LOG_LEVEL=info + COURIER_ADDRESS: 0.0.0.0 + COURIER_DB: postgres://temba:temba@postgres:5432/temba?sslmode=disable + COURIER_REDIS: redis://redis:6379/15 + COURIER_DOMAIN: ${COURIER_DOMAIN:-host.docker.internal} + COURIER_BASE_URL: ${COURIER_BASE_URL:-https://host.docker.internal} + COURIER_DISALLOWED_NETWORKS: 6.6.6.6 + COURIER_AUTH_TOKEN: topsecret + COURIER_AWS_ACCESS_KEY_ID: root + COURIER_AWS_SECRET_ACCESS_KEY: tembatemba + COURIER_DYNAMO_ENDPOINT: http://dynamo:6000 + COURIER_DYNAMO_TABLE_PREFIX: Temba + COURIER_S3_ENDPOINT: http://minio:9000 + COURIER_S3_ATTACHMENTS_BUCKET: temba-attachments + COURIER_S3_MINIO: true + COURIER_LOG_LEVEL: info indexer: image: nyaruka/indexer:stable build: - context: https://github.com/nyaruka/rp-indexer.git#v9.2.0 + context: https://github.com/nyaruka/rp-indexer.git#v10.0.0 dockerfile: Dockerfile depends_on: rapidpro: condition: service_healthy environment: - - INDEXER_DB=postgres://temba:temba@postgres:5432/temba?sslmode=disable - - INDEXER_ELASTIC_URL=http://elastic:9200 - - INDEXER_LOG_LEVEL=info + INDEXER_DB: postgres://temba:temba@postgres:5432/temba?sslmode=disable + INDEXER_ELASTIC_URL: http://elastic:9200 + INDEXER_LOG_LEVEL: info volumes: postgres: @@ -175,5 +196,7 @@ volumes: driver: local redis: driver: local + dynamo: + driver: local minio: driver: local diff --git a/rapidpro/Dockerfile b/rapidpro/Dockerfile index 0917462..7cce028 100644 --- a/rapidpro/Dockerfile +++ b/rapidpro/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-bullseye +FROM python:3.12-bullseye ARG RAPIDPRO_TAG ENV RAPIDPRO_TAG=${RAPIDPRO_TAG:-main} @@ -12,7 +12,7 @@ RUN npm install -g yarn less WORKDIR /rapidpro RUN wget -O rapidpro.tar.gz "https://github.com/nyaruka/rapidpro/archive/${RAPIDPRO_TAG}.tar.gz" && tar -xf rapidpro.tar.gz --strip-components=1 && rm rapidpro.tar.gz -RUN poetry install +RUN poetry install --no-root RUN yarn install RUN ln -s /rapidpro/temba/settings.py.dev /rapidpro/temba/settings.py diff --git a/rapidpro/entrypoint.sh b/rapidpro/entrypoint.sh index 299823c..164754f 100644 --- a/rapidpro/entrypoint.sh +++ b/rapidpro/entrypoint.sh @@ -7,6 +7,7 @@ ACTION=${1:-webapp} if [ "$ACTION" = "webapp" ]; then echo "Running RapidPro webapp..." poetry run python3 manage.py migrate + poetry run python3 manage.py migrate_dynamo poetry run python3 manage.py runserver 0.0.0.0:8000 elif [ "$ACTION" = "celery" ]; then echo "Running RapidPro celery worker..."