Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions apps/bitte-ai/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM oven/bun:1.2.1
FROM node:20-slim

WORKDIR /app

# Install Bun and PM2 for process management
RUN apt-get update && apt-get install -y curl unzip && \
curl -fsSL https://bun.sh/install | bash && \
ln -s $HOME/.bun/bin/bun /usr/local/bin/bun && \
npm install -g pm2

COPY package.json bun.lock ./
COPY apps/bitte-ai/package.json ./apps/bitte-ai/

Expand All @@ -16,5 +22,19 @@ RUN bun run build

EXPOSE 3000

# Run the compiled application
CMD ["bun", "run", "start"]
# Create PM2 configuration
RUN echo '{\
"apps": [{\
"name": "bitte-ai",\
"script": "dist/index.js",\
"instances": "1",\
"exec_mode": "cluster",\
"max_memory_restart": "500M",\
"env": {\
"NODE_ENV": "production"\
}\
}]\
}' > ecosystem.config.json

# Run with PM2 in production mode
CMD ["pm2-runtime", "ecosystem.config.json"]