diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4a38f1d2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use node.js 18 as the base image +FROM node:18 + +# Set the working directory +WORKDIR /app + +# Copy package.json and pnpm-lock.yaml +COPY package.json pnpm-lock.yaml ./ + +# Configure environment variables +ENV PNPM_HOME=/root/.local/share/pnpm +ENV PATH=$PNPM_HOME:$PATH +# Set the SHELL environment variable to bash +ENV SHELL=/bin/bash + +# Update the package and install the dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends curl bash && \ + curl -fsSL https://get.pnpm.io/install.sh | sh -s && \ + pnpm install + +# Copy the entire project files +COPY . . + +# Expose Application Port +EXPOSE 3000 + +# Run the app +CMD ["pnpm", "dev"] \ No newline at end of file diff --git a/README.md b/README.md index 6a0a74e3..1a90c7ba 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,24 @@ pnpm dev The app will be available at `http://localhost:3000`. +## Deploy + +First, clone the repository + +```bash +git clone https://github.com/langchain-ai/agent-chat-ui.git + +cd agent-chat-ui/docker +``` + +Deploy using docker-compose + +```bash +docker compose up -d +``` + +The app will be available at `http://localhost:3000`. + ## Usage Once the app is running (or if using the deployed site), you'll be prompted to enter: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..74a12a2f --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,12 @@ +name: agent-chat-ui +services: + app: + restart: unless-stopped + # Build the image using the Dockerfile in the project's root directory + build: ../ + # Set up port mapping + ports: + - "3000:3000" + volumes: + - ../:/app + - /app/node_modules \ No newline at end of file