mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 08:03:46 +00:00
feat: add Dockerfile for web frontend with Caddy
This commit is contained in:
parent
0b76ec9f3e
commit
7df4702936
1 changed files with 34 additions and 0 deletions
34
frontend/packages/web/Dockerfile
Normal file
34
frontend/packages/web/Dockerfile
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Copy package files for all workspaces
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY frontend/packages/web/package.json ./frontend/packages/web/
|
||||
COPY sdks/typescript/package.json ./sdks/typescript/
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --filter @sandbox-agent/web...
|
||||
|
||||
# Copy SDK source (with pre-generated types)
|
||||
COPY sdks/typescript ./sdks/typescript
|
||||
|
||||
# Build SDK (just tsc, skip generate since types are pre-generated)
|
||||
RUN cd sdks/typescript && pnpm exec tsc -p tsconfig.json
|
||||
|
||||
# Copy web source
|
||||
COPY frontend/packages/web ./frontend/packages/web
|
||||
|
||||
# Build web
|
||||
RUN cd frontend/packages/web && pnpm exec vite build
|
||||
|
||||
FROM caddy:alpine
|
||||
COPY --from=build /app/frontend/packages/web/dist /srv
|
||||
RUN cat > /etc/caddy/Caddyfile <<'EOF'
|
||||
:80 {
|
||||
root * /srv
|
||||
file_server
|
||||
try_files {path} /index.html
|
||||
}
|
||||
EOF
|
||||
EXPOSE 80
|
||||
Loading…
Add table
Add a link
Reference in a new issue