File size: 1,028 Bytes
07ca0c6
 
3e0a3e4
 
f9c7111
69cac33
848a281
 
f9c7111
 
d9a2ee1
f9c7111
9df9bab
 
 
07ca0c6
 
 
 
e95ca09
f9c7111
07ca0c6
 
9df9bab
07ca0c6
f9c7111
f4a6e14
3e0a3e4
9df9bab
3e0a3e4
9df9bab
f9c7111
b4f63e1
f4a6e14
3e0a3e4
f9c7111
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# ---- Build Stage ----
FROM node:20-slim AS builder
WORKDIR /app

# Install system tools required for node-gyp (better-sqlite3) and git
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
RUN npm install -g bun

# Clone the official AionUi repository
RUN git clone https://github.com/iOfficeAI/AionUi.git .

# Build the application using the project's own scripts
RUN bun install
RUN bun run build:renderer:web
RUN node scripts/build-server.mjs

# ---- Runtime Stage ----
FROM oven/bun:latest AS runtime
WORKDIR /app

# Copy built artifacts and package.json from the builder
COPY --from=builder /app/dist-server ./dist-server
COPY --from=builder /app/out/renderer ./out/renderer
COPY --from=builder /app/package.json ./

# Hugging Face specific environment configuration
ENV PORT=7860
ENV NODE_ENV=production
ENV ALLOW_REMOTE=true
ENV DATA_DIR=/data

# Create data directory for SQLite persistence
RUN mkdir -p /data
EXPOSE 7860

# Start the server
CMD ["bun", "dist-server/server.mjs"]