Hosting
Hosting Options
EventCatalog can be hosted in two ways:
Hosting a static website
By default EventCatalog will build a static website.
Here are some guides and places you can host static content
Community posts
- Using AWS CDK to Deploy EventCatalog
- Using Netlify to host Static Content
- How to create an EventCatlaog with Azure
- Autonomous EventCatalog for documenting EventBridge Events
Hosting static website with Docker
EventCatalog comes with a DockerFile you can build the image and deploy the container. The container exposes ports 3000.
To build the docker container you need to run:
# Builds the container
docker build -t eventcatalog .
# Runs the container locally
docker run -p 3000:80 -it eventcatalog
Hosting as a server
eventcatalog@2.35.4First you need to update your eventcatalog.config.js file to use SSR mode.
export default {
// defaults to static
output: 'server',
}
A server output is required if you are using any EventCatalog feature that requires a server, these include:
You can use the server Docker image to run the server, this is the recommended way to run the server.
First you need to create a Dockerfile for the server (if you don't already have one).
FROM node:lts AS runtime
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./
RUN npm install
COPY . .
# Fix for Astro in Docker: https://github.com/withastro/astro/issues/2596
ENV NODE_OPTIONS=--max_old_space_size=2048
RUN npm run build
ENV HOST=0.0.0.0
ENV PORT=3000
EXPOSE 3000
# Start the server. The exec form (a JSON array) passes `docker stop` (SIGTERM) on to the server,
# so it stops straight away rather than being killed after Docker's timeout.
CMD ["npm", "run", "start"]
Use the exec form of CMD (CMD ["npm", "run", "start"]) rather than the shell form (CMD npm run start). With the shell form, a shell runs as the container's first process and doesn't pass signals on, so docker stop and Kubernetes pod shutdowns wait for their timeout and then kill the server.
Then you can build the docker image with:
docker build -f Dockerfile.server -t eventcatalog-server .
Then you can run the server with:
docker run -p 3000:3000 eventcatalog-server
.env file is included in the server imageCOPY . . copies your .env file into the image, so EventCatalog can read your license key and other keys (for example OPENAI_API_KEY) during the build and when the server runs.
Anyone who can pull the image can read these keys. Only push the image to a private registry, and do not share it publicly.
Some features of EventCatalog require a server to run (e.g. EventCatalog Chat and EventCatalog Authentication).
If you have a large catalog, you may want to use SSR mode to reduce build times.