You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM kong:3.7
# Ensure any patching steps are executed as root user
USER root
# Add custom plugin to the image
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
RUN npm config set registry https://registry.npmmirror.com/
RUN npm install -g kong-pdk
ADD myjwt.js /usr/local/kong/js-plugins/
ADD package.json /usr/local/kong/js-plugins/
WORKDIR /usr/local/kong/js-plugins/
RUN npm install
WORKDIR /
# Ensure kong user is selected for image execution
USER kong
# Run kong
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 8000 8443 8001 8444
STOPSIGNAL SIGQUIT
HEALTHCHECK --interval=10s --timeout=10s --retries=10 CMD kong health
CMD ["kong", "docker-start"]
pulgin.js
'use strict';
// This is an example plugin that add a header to the response
class KongPlugin {
constructor(config) {
this.config = config
}
async access(kong) {
await Promise.all([
kong.response.setHeader("x-hello-from-javascript", "Javascript"),
kong.response.setHeader("x-javascript-pid", process.pid),
])
}
}
module.exports = {
Plugin: KongPlugin,
Schema: [
{ message: { type: "string" } },
],
Version: '0.1.0',
Priority: 0,
}
dockerfile
pulgin.js
package.json
helm chart value.yaml
log:
can someon help, thanks.
The text was updated successfully, but these errors were encountered: