-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile.working
More file actions
51 lines (37 loc) · 1.44 KB
/
Copy pathdockerfile.working
File metadata and controls
51 lines (37 loc) · 1.44 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Working minimal production Dockerfile for AWS free tier
FROM node:22-alpine AS base
WORKDIR /app
# Install only curl for health checks
RUN apk add --no-cache curl
# Use Yarn 3.5.1 via Corepack
ENV YARN_NODE_LINKER=node-modules
RUN corepack enable && corepack prepare yarn@3.5.1 --activate
# Copy only essential package files
COPY package.json yarn.lock ./
COPY apps/open-swe/package.json apps/open-swe/package.json
COPY packages/shared/package.json packages/shared/package.json
# Install dependencies
RUN yarn install --mode=skip-build
# Copy source code and build shared package
COPY packages/shared ./packages/shared
COPY apps/open-swe ./apps/open-swe
# Build the shared package
RUN cd packages/shared && yarn build
# Production stage - minimal runtime
FROM node:22-alpine AS production
WORKDIR /app
# Install only curl for health checks
RUN apk add --no-cache curl
# Copy only the absolute minimum needed
COPY --from=base /app/apps/open-swe/package.json ./
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/apps/open-swe/src ./src
COPY --from=base /app/apps/open-swe/langgraph.json ./
COPY --from=base /app/packages/shared ./packages/shared
# Expose port
EXPOSE 10000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:10000/health || exit 1
# Run the app
CMD ["npx", "langgraphjs", "dev", "--host", "0.0.0.0", "--port", "10000", "--config", "langgraph.json"]