Skip to content

Commit 14d451e

Browse files
committed
feat(backend): add hybrid Dockerfile for Railway support
1 parent b424e2f commit 14d451e

1 file changed

Lines changed: 23 additions & 13 deletions

File tree

backend/Dockerfile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
# Use Node.js LTS
2-
FROM node:20-slim
1+
# Hybrid Node.js + Python Dockerfile for Railway (grantgoblin)
2+
FROM python:3.11-slim-bookworm
3+
4+
# 1. Install System Dependencies & Node.js
5+
RUN apt-get update && apt-get install -y \
6+
curl \
7+
git \
8+
build-essential \
9+
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
10+
&& apt-get install -y nodejs \
11+
&& apt-get clean \
12+
&& rm -rf /var/lib/apt/lists/*
313

4-
# Set working directory
514
WORKDIR /app
615

7-
# Copy package files
8-
COPY package*.json ./
16+
# 2. Python Setup (Heavy dependencies)
17+
# Copy strict requirements or just the researcher one
18+
COPY ai-researcher/requirements.txt ./requirements.txt
19+
RUN pip install --no-cache-dir -r requirements.txt
920

10-
# Install dependencies
21+
# 3. Node.js Setup
22+
COPY package.json package-lock.json* ./
1123
RUN npm ci --only=production
1224

13-
# Copy source code
25+
# 4. Copy Application Source
1426
COPY . .
1527

16-
# Expose port
17-
EXPOSE 3000
18-
19-
# Set environment variables
28+
# 5. Environment & Startup
2029
ENV NODE_ENV=production
21-
ENV PORT=3000
30+
ENV PYTHONUNBUFFERED=1
31+
EXPOSE 3000
2232

23-
# Start the server
33+
# Start Express Server (which spawns Python scripts)
2434
CMD ["npm", "start"]

0 commit comments

Comments
 (0)