mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
reverting entrypoint
This commit is contained in:
parent
f8aa276c36
commit
0e4026bd8d
2 changed files with 1 additions and 48 deletions
|
|
@ -23,8 +23,7 @@ ENV BASE_PATH $BASE_PATH
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
RUN ALLOWED_FRAME_URLS=/__ENTRYPOINT__ yarn build-docker
|
RUN yarn build-docker
|
||||||
ENV ALLOWED_FRAME_URLS=""
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM node:18-alpine AS runner
|
FROM node:18-alpine AS runner
|
||||||
|
|
@ -52,10 +51,6 @@ COPY --from=builder /app/scripts ./scripts
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
|
||||||
# Create entrypoint script
|
|
||||||
COPY entrypoint.sh ./entrypoint.sh
|
|
||||||
RUN chmod +x ./entrypoint.sh
|
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
@ -63,6 +58,4 @@ EXPOSE 3000
|
||||||
ENV HOSTNAME 0.0.0.0
|
ENV HOSTNAME 0.0.0.0
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
|
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
|
||||||
|
|
||||||
CMD ["yarn", "start-docker"]
|
CMD ["yarn", "start-docker"]
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# replace /__ENTRYPOINT__ with the runtime-configured entrypoint
|
|
||||||
if [ "$ALLOWED_FRAME_URLS" = "" ]; then
|
|
||||||
# root entrypoint is handled differently from non-root, in particular
|
|
||||||
# - basePath="" rather than "/"
|
|
||||||
# - an extra redirect is added /x/ => /x -- but with root that would be // => / which is invalid
|
|
||||||
cp .next/routes-manifest.json .next/routes-manifest.json.in
|
|
||||||
jq -rc '.basePath = ""
|
|
||||||
| .redirects = [
|
|
||||||
.redirects
|
|
||||||
| .[]
|
|
||||||
| select((.source == "/__ENTRYPOINT__/" and .destination == "/__ENTRYPOINT__") | not)
|
|
||||||
]' .next/routes-manifest.json.in > .next/routes-manifest.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
escaped_frame_urls=$(echo "$ALLOWED_FRAME_URLS" | sed 's/\//\\\//g')
|
|
||||||
|
|
||||||
echo "Replacing /__ENTRYPOINT__ in all .next file..."
|
|
||||||
find .next -type f -exec sed -i 's/\/__ENTRYPOINT__/'"${escaped_frame_urls}"'/g' {} +
|
|
||||||
|
|
||||||
# Check if any replacements were made in .next files
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Replacements in .next completed."
|
|
||||||
else
|
|
||||||
echo "No replacements made in .next or an error occurred."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Replace /__ENTRYPOINT__ in server.js
|
|
||||||
echo "Replacing /__ENTRYPOINT__ in server.js..."
|
|
||||||
sed -i "s/\/__ENTRYPOINT__/${escaped_frame_urls}/g" server.js
|
|
||||||
|
|
||||||
# Check if any replacements were made in server.js
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Replacements in server.js completed."
|
|
||||||
else
|
|
||||||
echo "No replacements made in server.js or an error occurred."
|
|
||||||
fi
|
|
||||||
|
|
||||||
$@
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue