diff --git a/apps/cic-meta/docker/Dockerfile b/apps/cic-meta/docker/Dockerfile index aa4c6a28..03ffcfc6 100644 --- a/apps/cic-meta/docker/Dockerfile +++ b/apps/cic-meta/docker/Dockerfile @@ -1,16 +1,16 @@ -# syntax = docker/dockerfile:1.2 -#FROM node:15.3.0-alpine3.10 -FROM node:lts-alpine3.14 +FROM node:15.3.0-alpine3.10 +#FROM node:lts-alpine3.14 WORKDIR /root RUN apk add --no-cache postgresql bash # copy the dependencies -COPY package.json package-lock.json . -RUN --mount=type=cache,mode=0755,target=/root/.npm \ - npm set cache /root/.npm && \ - npm ci +COPY package.json package-lock.json ./ +#RUN --mount=type=cache,mode=0755,target=/root/.npm \ +RUN npm set cache /root/.npm && \ + npm cache verify && \ + npm ci --verbose COPY webpack.config.js . COPY tsconfig.json . diff --git a/apps/cic-ussd/docker/Dockerfile b/apps/cic-ussd/docker/Dockerfile index 82120dc0..87c136cd 100644 --- a/apps/cic-ussd/docker/Dockerfile +++ b/apps/cic-ussd/docker/Dockerfile @@ -1,5 +1,7 @@ -# syntax = docker/dockerfile:1.2 -FROM registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev-55da5f4e as dev +ARG DOCKER_REGISTRY="registry.gitlab.com/grassrootseconomics" + +FROM $DOCKER_REGISTRY/cic-base-images:python-3.8.6-dev-55da5f4e + RUN apt-get install -y redis-server # create secrets directory RUN mkdir -vp pgp/keys @@ -8,28 +10,33 @@ RUN mkdir -vp pgp/keys RUN mkdir -vp cic-ussd RUN mkdir -vp data -ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" -ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_INDEX_URL=https://pip.grassrootseconomics.net:8433 +ARG EXTRA_PIP_ARGS="" +ARG PIP_INDEX_URL=https://pypi.org/simple -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY \ - --extra-index-url $EXTRA_INDEX_URL \ - cic-eth-aux-erc20-demurrage-token~=0.0.2a6 +RUN pip install --index-url $PIP_INDEX_URL \ + --pre \ + --force-reinstall \ + --no-cache \ + --extra-index-url $EXTRA_PIP_INDEX_URL $EXTRA_PIP_ARGS \ + cic-eth-aux-erc20-demurrage-token~=0.0.2a7 -COPY requirements.txt . -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \ - -r requirements.txt +COPY *requirements.txt ./ +RUN pip install --index-url $PIP_INDEX_URL \ + --pre \ + --force-reinstall \ + --no-cache \ + --extra-index-url $EXTRA_PIP_INDEX_URL $EXTRA_PIP_ARGS \ + -r requirements.txt + COPY . . RUN python setup.py install COPY cic_ussd/db/ussd_menu.json data/ -COPY docker/*.sh . +COPY docker/*.sh ./ RUN chmod +x /root/*.sh # copy config and migration files to definitive file so they can be referenced in path definitions for running scripts diff --git a/docker-compose_local.yml b/docker-compose_local.yml index a7f3c499..0d37d646 100644 --- a/docker-compose_local.yml +++ b/docker-compose_local.yml @@ -476,3 +476,64 @@ services: - ./apps/contract-migration/testdata/pgp/:/tmp/cic/pgp + cic-user-tasker: + image: ${DEV_DOCKER_REGISTRY:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-user:${TAG:-latest} + hostname: meta + build: + context: apps/cic-ussd + dockerfile: docker/Dockerfile + args: + DOCKER_REGISTRY: ${DEV_DOCKER_REGISTRY:-registry.gitlab.com/grassrootseconomics} + environment: + DATABASE_HOST: ${DATABASE_HOST:-postgres} + DATABASE_PORT: ${DATABASE_PORT:-5432} + DATABASE_NAME: ${DATABASE_NAME:-cic_user} + DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala} + DATABASE_USER: ${DATABASE_USER:-grassroots} + DATABASE_ENGINE: ${DATABASE_ENGINE:-postgres} + DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2} + DATABASE_DEBUG: ${DATABASE_DEBUG:-0} + DATABASE_POOL_SIZE: 0 + CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis} + CELERY_RESULT_URL: ${CELERY_BROKER_URL:-redis://redis} + PGP_PASSPHRASE: merman + CIC_META_URL: ${CIC_META_URL:-http://meta:8000} + restart: unless-stopped + depends_on: + - postgres + - redis + #- cic-meta-server + - cic-eth-tasker + - cic-cache-tasker + volumes: + - ./apps/contract-migration/testdata/pgp/:/usr/src/secrets/ + command: "/root/start_cic_user_tasker.sh -q cic-ussd -vv" + + + cic-user-tasker: + image: ${DEV_DOCKER_REGISTRY:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-user:${TAG:-latest} + build: + context: apps/cic-ussd + dockerfile: docker/Dockerfile + args: + DOCKER_REGISTRY: ${DEV_DOCKER_REGISTRY:-registry.gitlab.com/grassrootseconomics} + PIP_INDEX_URL: ${PIP_INDEX_URL:-https://pypi.org/simple} + EXTRA_PIP_INDEX_URL: ${EXTRA_PIP_INDEX_URL:-https://pip.grassrootseconomics.net:8433} + EXTRA_PIP_ARGS: $EXTRA_PIP_ARGS + environment: + DATABASE_HOST: ${DATABASE_HOST:-postgres} + DATABASE_PORT: ${DATABASE_PORT:-5432} + DATABASE_NAME: ${DATABASE_NAME:-cic_user} + DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala} + DATABASE_USER: ${DATABASE_USER:-grassroots} + DATABASE_ENGINE: ${DATABASE_ENGINE:-postgres} + DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2} + DATABASE_DEBUG: ${DATABASE_DEBUG:-0} + DATABASE_POOL_SIZE: 0 + restart: on-failure + ports: + - ${DEV_CIC_USER_SERVER_PORT:-63415}:9500 + depends_on: + - postgres + - redis + command: "/root/start_cic_user_server.sh -vv"