-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* wip: move contact setup raw feature * feat(#12): add centralized queue layer & cleanup * fix(#12): oups test * fix(#12): get this test pass * fix(#12): lint * feat: address feedback part 1 * fix(#12): failing test * feat(#12): fix review feedback part2 * feat(#12): fix review feedback part2 * fix(#12): job postponed * fix(#12): update postponed test * feat(#12): make this toast display * ref(#12): remove move_result.html as no more used * fix(#12): address docker feedback * Apply suggestions from code review * fix(#12): address feedback part 5 * ref(#12): switch to an official version of cht-conf support session * Apply suggestions from code review * doc(#12): update readme * fix(#12): add integration test + feedback * 1.4.0
- Loading branch information
1 parent
4d93578
commit 975d57c
Showing
31 changed files
with
11,752 additions
and
2,745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ dist | |
src/package.json | ||
.eslintcache | ||
.DS_Store | ||
json_docs | ||
upload-docs.*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN apk add git | ||
RUN npm ci --omit=dev | ||
|
||
COPY src ./src | ||
COPY tsconfig.json ./ | ||
RUN npm run build | ||
|
||
CMD npm run start:worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
version: '3.7' | ||
|
||
services: | ||
redis: | ||
image: redis:6.2-alpine | ||
restart: always | ||
volumes: | ||
- redis-data:/data | ||
|
||
cht-user-management: | ||
image: public.ecr.aws/medic/cht-user-management:latest | ||
image: ${CHT_USER_MANAGEMENT_IMAGE:-public.ecr.aws/medic/cht-user-management:latest} | ||
environment: | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- EXTERNAL_PORT=${EXTERNAL_PORT:-3000} | ||
- COOKIE_PRIVATE_KEY=${COOKIE_PRIVATE_KEY} | ||
- WORKER_PRIVATE_KEY=${WORKER_PRIVATE_KEY} | ||
- CONFIG_NAME=${CONFIG_NAME} | ||
- CHT_DEV_HTTP=${CHT_DEV_HTTP} | ||
- CHT_DEV_URL_PORT=${CHT_DEV_URL_PORT} | ||
- REDIS_HOST=${REDIS_HOST:-redis} | ||
- REDIS_PORT=${REDIS_PORT:-6379} | ||
ports: | ||
- '${EXTERNAL_PORT-3000}:${PORT:-3000}' | ||
restart: always | ||
command: npm start | ||
depends_on: | ||
- redis | ||
|
||
cht-user-management-worker: | ||
image: ${CHT_USER_MANAGEMENT_WORKER_IMAGE:-public.ecr.aws/medic/cht-user-management-worker:latest} | ||
restart: always | ||
command: npm run start:worker | ||
environment: | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- REDIS_HOST=${REDIS_HOST:-redis} | ||
- REDIS_PORT=${REDIS_PORT:-6379} | ||
- WORKER_PRIVATE_KEY=${WORKER_PRIVATE_KEY} | ||
depends_on: | ||
- redis | ||
|
||
volumes: | ||
redis-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
#!/bin/bash | ||
set -e | ||
|
||
if [ ! -f ".env" ]; then | ||
echo "Please create a .env file first. Copy the env.example and edit the new file" | ||
exit 1 | ||
fi | ||
. .env | ||
|
||
if [[ -n $1 ]] && [[ $1 == "build" ]]; then | ||
docker build -f Dockerfile -t cht-user-management:local . | ||
docker build -f Dockerfile.worker -t cht-user-management-worker:local . | ||
elif [[ -z "$(docker images -q cht-user-management:local 2> /dev/null)" ]] || [[ -z "$(docker images -q cht-user-management-worker:local 2> /dev/null)" ]]; then | ||
echo;echo "Docker images not found - please call | ||
./docker-local-setup.sh build | ||
to build missing images";echo; | ||
exit 1 | ||
fi | ||
|
||
echo;echo "Starting Docker Compose...";echo | ||
CHT_USER_MANAGEMENT_IMAGE=cht-user-management:local CHT_USER_MANAGEMENT_WORKER_IMAGE=cht-user-management-worker:local docker compose up -d | ||
|
||
echo;echo "Server is now running at http://127.0.0.1:$EXTERNAL_PORT/login";echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
COOKIE_PRIVATE_KEY= | ||
CONFIG_NAME=chis-ke | ||
PORT=3000 # for development environment | ||
EXTERNAL_PORT=3000 # for docker | ||
INTERFACE=0.0.0.0 # Leave as '0.0.0.0' for prod, suggest '127.0.0.1' for development | ||
CHT_DEV_URL_PORT=localhost:5984 # where your dev CHT instance is, hostname:port | ||
CHT_DEV_HTTP=true # 'false' for http 'true' for https | ||
NODE_ENV= # set to "dev" to use CHT_DEV_URL_PORT below, leave empty for production | ||
COOKIE_PRIVATE_KEY= # unique random key, use uuidgen to populate | ||
WORKER_PRIVATE_KEY= # unique random key, use uuidgen to populate. different from COOKIE_PRIVATE_KEY | ||
CONFIG_NAME=chis-ke # Name of the configuration | ||
PORT=3000 # for development environmentcontainer) | ||
EXTERNAL_PORT=3000 # for docker | ||
INTERFACE=0.0.0.0 # Leave as '0.0.0.0' for prod, suggest '127.0.0.1' for development | ||
#REDIS_HOST=redis # Redis server hostname - only uncomment if you know what you're doing | ||
#REDIS_PORT=6378 # Redis server port - only uncomment if you know what you're doing | ||
CHT_DEV_HTTP=false # 'true' for http 'false' for https | ||
CHT_DEV_URL_PORT=localhost:5984 # where your dev CHT instance is, hostname:port | ||
#CHT_USER_MANAGEMENT_IMAGE=cht-user-management:local # docker image for cht-user-management service - uncomment to use with local development | ||
#CHT_USER_MANAGEMENT_WORKER_IMAGE=cht-user-management-worker:local # docker image for worker service - uncomment to use with local development |
Oops, something went wrong.