Skip to content

Commit

Permalink
Fix deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtechera committed Jul 18, 2024
1 parent 17a1a0d commit 26ef807
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/go/dockerfile-reference/

FROM node:20-alpine as base
FROM --platform=linux/amd64 node:20-alpine as base

WORKDIR /app

Expand Down Expand Up @@ -33,7 +33,7 @@ RUN turbo prune --scope=flowise --docker
################################################################################

# Create a stage for building the application.
FROM base as build
FROM --platform=linux/amd64 base as build

COPY --from=pruner /app/out/json/ .

Expand All @@ -51,7 +51,7 @@ RUN --mount=type=cache,target=/app/node_modules/.cache pnpm run build --filter f

################################################################################

FROM base AS runner
FROM --platform=linux/amd64 base AS runner

ENV NODE_ENV production

Expand All @@ -62,9 +62,12 @@ WORKDIR /app/packages/server
# Expose the port that the application listens on.
EXPOSE 4000

# Ensure the script exists and has the correct permissions
COPY update_ui_env.sh /docker-entrypoint.d/update_ui_env.sh
RUN chmod +x /docker-entrypoint.d/update_ui_env.sh
RUN dos2unix /docker-entrypoint.d/update_ui_env.sh && \
chmod +x /docker-entrypoint.d/update_ui_env.sh && \
ls -l /docker-entrypoint.d/update_ui_env.sh

# Run the application.
ENTRYPOINT ["/docker-entrypoint.d/update_ui_env.sh"]
CMD ["pnpm", "start"]
CMD ["pnpm", "start"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
"@google/generative-ai": "^0.7.0",
"openai": "4.38.3"
},
"packageManager": "pnpm@9.1.4"
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
}
32 changes: 16 additions & 16 deletions update_ui_env.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh
for i in $(env | grep MY_APP_); do
key=$(echo $i | cut -d '=' -f 1)
value=$(echo $i | cut -d '=' -f 2-)
if [ -z "$value" ]; then
continue
fi
echo $key=$value
# sed All files
#find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' +

# sed JS and CSS only
find /app/packages/ui -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' +
done

exec "$@"
#!/bin/sh
for i in $(env | grep MY_APP_); do
key=$(echo $i | cut -d '=' -f 1)
value=$(echo $i | cut -d '=' -f 2-)
if [ -z "$value" ]; then
continue
fi
echo $key=$value
# sed All files
#find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' +

# sed JS and CSS only
find /app/packages/ui -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' +
done

exec "$@"

0 comments on commit 26ef807

Please sign in to comment.