diff --git a/Makefile.toml b/Makefile.toml index 77874f4..30d9312 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -202,13 +202,13 @@ cd ../../ docker build . --build-arg APP_NAME="${APP_NAME}" \ --build-arg APP_DIR="${APP_DIR}" \ - --build-arg SERVICE="saleor-app-${APP_NAME}" \ - --build-arg TITLE="djkato/saleor-app-${APP_NAME}" \ - --build-arg DESC="Saleor app for ${APP_NAME}" \ - --build-arg URL="https://github.com/saleor/saleor-app-${APP_NAME}" \ + --build-arg SERVICE="saleor-app-${APP_DIR}" \ + --build-arg TITLE="djkato/saleor-app-${APP_DIR}" \ + --build-arg DESC="Saleor app for ${APP_DIR}" \ + --build-arg URL="https://github.com/saleor/saleor-app-${APP_DIR}" \ --build-arg SOURCE="https://github.com/djkato/saleor-dockerize-all-apps" \ --build-arg AUTHORS="Saleor , Djkáťo " \ - -t ${CONTAINER_PUSH_URL}/saleor-app-${APP_NAME}:${VERSION} + -t ${CONTAINER_PUSH_URL}/saleor-app-${APP_DIR}:${VERSION} ''' [tasks.build-arg-old-app] diff --git a/README.md b/README.md index 5be43b4..bdc005d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,50 @@ Current apps in repo: All apps from saleor/apps are upwards of 1.5gb in size, because of [this pnpm workspace error](https://github.com/vercel/next.js/issues/65636) -## How to use +# How to use + +These images include RedisAPL, and that's what I recommend to use it with. Besides that, use it like any other docker image. +For example: + +```yml +services: + app-payment-stripe: + image: ghcr.io/djkato/saleor-app-payment-stripe:0.4.0 + env_file: + - stripe.env + networks: + - saleor-app-tier + depends_on: + - redis-apl + ports: + - 3001:3001 + + redis-apl: + image: bitnami/redis:latest + environment: + - ALLOW_EMPTY_PASSWORD=yes + - DISABLE_COMMANDS=FLUSHDB,FLUSHALL,CONFIG + ports: + - 6380:6379 + networks: + - saleor-app-tier + volumes: + - redis-apl:/bitnami/redis/data + +volumes: + redis-apl: + driver: local + driver_opts: + type: none + device: ./temp/volumes/redis/ + o: bind + +networks: + saleor-app-tier: + driver: bridge +``` + +## How to build - `./changes.sh` - applies git patches and batch edits via rust to add RedisAPL to all apps, and allow them to build via other tweaks. - `cargo make build-all` or `cargo make build-` diff --git a/apps.Dockerfile b/apps.Dockerfile index 740de02..9c217ca 100644 --- a/apps.Dockerfile +++ b/apps.Dockerfile @@ -32,7 +32,7 @@ RUN pnpm i # Build the project COPY --from=builder /app/out/full/ . -RUN turbo run build --filter="$APP_NAME"... +RUN HOSTNAME="0.0.0.0" turbo run build --filter="$APP_NAME"... FROM base AS runner @@ -61,7 +61,7 @@ COPY --from=installer --chown=nextjs:nodejs /app/node_modules ./node_modules # COPY --from=installer --chown=nextjs:nodejs /app/node_modules/react/jsx-runtime ./node_modules/react/jsx-runtime WORKDIR /app/apps/$APP_DIR -CMD node server.js +CMD HOSTNAME="0.0.0.0" node server.js ARG SERVICE ARG TITLE ARG DESC diff --git a/changes.sh b/changes.sh index b9c84ea..afa4c82 100755 --- a/changes.sh +++ b/changes.sh @@ -20,6 +20,7 @@ app_paths=( "apps/apps/segment" "apps/apps/slack" "apps/apps/taxjar" + "apps/apps/smtp" "saleor-app-abandoned-checkouts" "saleor-app-payment-authorize.net" "saleor-app-payment-klarna" @@ -39,6 +40,7 @@ redis_apl_target_paths=( "apps/apps/segment/src" "apps/apps/slack/src/lib" "apps/apps/taxjar" + "apps/apps/smtp/src" "saleor-app-abandoned-checkouts" "saleor-app-payment-authorize.net/src" "saleor-app-payment-klarna/src" @@ -100,3 +102,8 @@ for i in ${app_paths[*]}; do echo "installed ioredis for $i" cd "$CURR_PWD" done + +# Individual patches +cd ./all_apps/apps +git appy "$CURR_PWD/patches/apps/slack/env.d.ts.patch" +cd "$CURR_PWD" diff --git a/emails.test.env b/emails.test.env new file mode 100644 index 0000000..f86ddf8 --- /dev/null +++ b/emails.test.env @@ -0,0 +1,6 @@ +REDIS_URL=redis://redis-apl:6379/1 +APL=redis +SECRET_KEY=idS8Oedýžfmg90S87Edfgnm90S87Dmfgiosuhbfs +APP_IFRAME_BASE_URL=https://app-emails.kremik.sk +APP_API_BASE_URL=https://app-emails.kremik.sk +APP_LOG_LEVEL=info diff --git a/patches/apps/slack/env.d.ts.patch b/patches/apps/slack/env.d.ts.patch new file mode 100644 index 0000000..454d033 --- /dev/null +++ b/patches/apps/slack/env.d.ts.patch @@ -0,0 +1,11 @@ +diff --git a/apps/slack/env.d.ts b/apps/slack/env.d.ts +index 58003aae..ee9f59ad 100644 +--- a/apps/slack/env.d.ts ++++ b/apps/slack/env.d.ts +@@ -1,5 +1,5 @@ + namespace NodeJS { + interface ProcessEnv { +- APL: "file" | "upstash" | "saleor-cloud"; ++ APL: "file" | "upstash" | "saleor-cloud" | "redis"; + } + }