Add Docker support with Dockerfile and docker-compose.yml, update build scripts and README for containerized deployment.

- Updated server `Bun.build` configuration: adjusted `outdir`, added `format` as `esm`, and set `@open-gsio/client` to external.
- Expanded README with Docker instructions.
- Added new package `@open-gsio/analytics-worker`.
- Upgraded dependencies (`vite`, `typescript`, `bun`) and locked `pnpm` version in `package.json`.
This commit is contained in:
geoffsee
2025-06-25 18:13:52 -04:00
parent 1dab5aaa14
commit c8e6da2d15
10 changed files with 199 additions and 48 deletions

51
Dockerfile Normal file
View File

@@ -0,0 +1,51 @@
FROM oven/bun:latest
WORKDIR /app
# Copy package files first for better caching
COPY package.json bun.lock ./
# Create directory structure for all packages
RUN mkdir -p packages/ai packages/ai/src/types packages/client packages/coordinators packages/env packages/router packages/schema packages/scripts packages/server packages/services packages/cloudflare-workers/analytics packages/cloudflare-workers/open-gsio
# Copy package.json files for all packages
COPY packages/ai/package.json ./packages/ai/
COPY packages/ai/src/types/package.json ./packages/ai/src/types/
COPY packages/client/package.json ./packages/client/
COPY packages/coordinators/package.json ./packages/coordinators/
COPY packages/env/package.json ./packages/env/
COPY packages/router/package.json ./packages/router/
COPY packages/schema/package.json ./packages/schema/
COPY packages/scripts/package.json ./packages/scripts/
COPY packages/server/package.json ./packages/server/
COPY packages/services/package.json ./packages/services/
COPY packages/cloudflare-workers/analytics/package.json ./packages/cloudflare-workers/analytics/
COPY packages/cloudflare-workers/open-gsio/package.json ./packages/cloudflare-workers/open-gsio/
# Install dependencies
RUN bun install
# Copy the rest of the application
COPY . .
# Create .env file if it doesn't exist
RUN touch ./packages/server/.env
# Build client and server
RUN bun build:client && bun build:server
# Ensure the client directories exist
RUN mkdir -p ./client/public ./client/dist/client
# Copy client files to the expected locations
RUN cp -r ./packages/client/public/* ./client/public/ || true
RUN cp -r ./packages/client/dist/* ./client/dist/ || true
EXPOSE 3003
# Verify server.js exists
RUN test -f ./packages/server/dist/server.js || (echo "Error: server.js not found" && exit 1)
CMD ["bun", "./packages/server/dist/server.js"]